diff options
author | David Aguilar <davvid@gmail.com> | 2008-05-29 02:14:25 -0700 |
---|---|---|
committer | David Aguilar <davvid@gmail.com> | 2008-05-29 02:14:25 -0700 |
commit | 4a061029eddee38110e416e3c4f60d553dafc9e5 (patch) | |
tree | 73b3e17779d84aba078fce339ddae99c40ced1e1 /test/git/test_git.py | |
parent | 323259cc3d977235f4e7e8980219e5e96d66086e (diff) | |
download | gitpython-4a061029eddee38110e416e3c4f60d553dafc9e5.tar.gz |
tests: add a test for git.foo( with_exceptions=True )
This test ensures that a GitCommandError is raised when git
returns a non-zero exit status.
Signed-off-by: David Aguilar <davvid@gmail.com>
Diffstat (limited to 'test/git/test_git.py')
-rw-r--r-- | test/git/test_git.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/git/test_git.py b/test/git/test_git.py index 63343d91..47066941 100644 --- a/test/git/test_git.py +++ b/test/git/test_git.py @@ -1,6 +1,7 @@ import os from test.testlib import * -from git_python import * +from git_python import Git +from git_python import errors class TestGit(object): def setup(self): @@ -35,3 +36,11 @@ class TestGit(object): def test_it_returns_status_and_ignores_stderr(self): assert_equal( (1, ""), self.git.this_does_not_exist(with_status=True) ) + + def test_it_raises_errors(self): + error_raised = False + try: + self.git.this_does_not_exist(with_exceptions=True) + except errors.GitCommandError, e: + error_raised = True + assert_equal( True, error_raised ) |