summaryrefslogtreecommitdiffstats
path: root/tests/helper_install_progress_run.py
diff options
context:
space:
mode:
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