]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/t/thelpers.py
helpers.py: use returncode to get the subprocess exit code in readpipe().
[bup.git] / lib / bup / t / thelpers.py
index 2e113c897e3f91ab73abcee89af0f2d3fb56638a..fd041ffb792e3586259581dd70719ccf7b4c867a 100644 (file)
@@ -77,3 +77,13 @@ def test_grafted_path_components():
              [('', None), ('a', None), ('b', None), ('c', '/'),
               ('foo', '/foo'), ('bar', '/foo/bar')])
     WVEXCEPT(Exception, grafted_path_components, 'foo', [])
+
+
+@wvtest
+def test_readpipe():
+    x = readpipe(['echo', '42'])
+    WVPASSEQ(x, '42\n')
+    try:
+        readpipe(['bash', '-c', 'exit 42'])
+    except Exception, ex:
+        WVPASSEQ(str(ex), "subprocess 'bash -c exit 42' failed with status 42")