tests: add a test for the new with_stderr mechanism
authorDavid Aguilar <davvid@gmail.com>
Thu, 29 May 2008 09:17:13 +0000 (02:17 -0700)
committerDavid Aguilar <davvid@gmail.com>
Thu, 29 May 2008 09:17:13 +0000 (02:17 -0700)
This test ensures that stderr is merged into stdout when
git.foo( with_stderr=True ) is called.

Signed-off-by: David Aguilar <davvid@gmail.com>
test/git/test_git.py

index 470669419034724cbc38527089b718bc5e2aa73b..9984e4e0653a826cb8e94737254145af37e79a25 100644 (file)
@@ -44,3 +44,8 @@ class TestGit(object):
         except errors.GitCommandError, e:
             error_raised = True
         assert_equal( True, error_raised )
+
+    def test_it_returns_stderr_in_output(self):
+        # Note: no trailiing newline
+        assert_equal( "git: 'this-does-not-exist' is not a git-command. See 'git --help'.",
+                      self.git.this_does_not_exist(with_stderr=True) )