summaryrefslogtreecommitdiffstats
path: root/tests/helper_install_progress_run.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:07:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:07:41 +0000
commit76926159194e180003aa78de97e5f287bf4325a5 (patch)
tree2cea7245cdc3f66355900c820c145eba90598766 /tests/helper_install_progress_run.py
parentInitial commit. (diff)
downloadpython-apt-76926159194e180003aa78de97e5f287bf4325a5.tar.xz
python-apt-76926159194e180003aa78de97e5f287bf4325a5.zip
Adding upstream version 2.7.6.upstream/2.7.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/helper_install_progress_run.py')
-rwxr-xr-xtests/helper_install_progress_run.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/helper_install_progress_run.py b/tests/helper_install_progress_run.py
new file mode 100755
index 0000000..02e601d
--- /dev/null
+++ b/tests/helper_install_progress_run.py
@@ -0,0 +1,15 @@
+#!/usr/bin/python3
+#
+# Copyright (C) 2019 Colomban Wendling <cwendling@hypra.fr>
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+"""Helper checking argv[1] is a valid, writable, file descriptor"""
+
+import os
+from sys import argv
+
+assert len(argv) == 2
+with os.fdopen(int(argv[1]), "w") as f:
+ assert f.write("test") == 4