diff options
author | Florian Apolloner <florian@apolloner.eu> | 2008-06-20 23:22:52 +0200 |
---|---|---|
committer | Florian Apolloner <florian@apolloner.eu> | 2008-06-20 23:22:52 +0200 |
commit | 5b01b589e7a19d6be5bd6465e600f84aa8015282 (patch) | |
tree | b1ff3f59c4cac75bcb0e2124b68dd75bf42d1f1f /test/git/test_git.py | |
parent | 66beac619ba944afeca9d15c56ccc60d5276a799 (diff) | |
download | gitpython-5b01b589e7a19d6be5bd6465e600f84aa8015282.tar.gz |
made with_exceptions=True default (don't look before you leak ;)) and removed the combined output of stderr and stdout.
Also renamed with_status to extended_output.
The method_missing function needs to be modified, as it does a kwargs.pop(xxx, None); which resulted in with_excpetions=None -> False all the time...
Test should follow tomorrow.
Diffstat (limited to 'test/git/test_git.py')
-rw-r--r-- | test/git/test_git.py | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/test/git/test_git.py b/test/git/test_git.py index e452e68b..0c074ec3 100644 --- a/test/git/test_git.py +++ b/test/git/test_git.py @@ -14,6 +14,11 @@ class TestGit(object): assert_true(git.called) # assert_equal(git.call_args, ((("%s version " % self.git_bin_base),), {})) + @raises(GitCommandError) + def test_it_raises_errors(self): + self.git.this_does_not_exist() + + def test_it_transforms_kwargs_into_git_command_arguments(self): assert_equal(["-s"], self.git.transform_kwargs(**{'s': True})) assert_equal(["-s5"], self.git.transform_kwargs(**{'s': 5})) @@ -33,25 +38,6 @@ class TestGit(object): self.git.hash_object(istream=fh, stdin=True)) fh.close() - def test_it_returns_status_and_ignores_stderr(self): - assert_equal((1, ""), self.git.this_does_not_exist(with_status=True)) - - @raises(GitCommandError) - def test_it_raises_errors(self): - self.git.this_does_not_exist(with_exceptions=True) - - def test_it_returns_stderr_in_output(self): - # Note: no trailiing newline - assert_match(r"^git: 'this-does-not-exist' is not a git-command", - self.git.this_does_not_exist(with_stderr=True)) - - def test_it_does_not_strip_output_when_using_with_raw_output(self): - # Note: trailing newline - assert_match(r"^git: 'this-does-not-exist' is not a git-command" \ - r"(\. See 'git --help'\.)?" + os.linesep, - self.git.this_does_not_exist(with_stderr=True, - with_raw_output=True)) - def test_it_handles_large_input(self): output = self.git.execute(["cat", "/bin/bash"]) assert_true(len(output) > 4096) # at least 4k |