diff options
author | Michael Trier <mtrier@gmail.com> | 2008-05-30 21:01:44 -0400 |
---|---|---|
committer | Michael Trier <mtrier@gmail.com> | 2008-05-30 21:01:44 -0400 |
commit | 233e3ffe0ef35dbabe49340ba567499690dcc166 (patch) | |
tree | 289bb04b3a806a20fe5b7b831a4643e2fcfd0190 /test/git/test_git.py | |
parent | 7b675bf555e89e708f1b8f79bd90796dd395837b (diff) | |
download | gitpython-233e3ffe0ef35dbabe49340ba567499690dcc166.tar.gz |
renamed git_python to git. Removed pop_key and replaced with dict.pop. Fixed up tests so they pass except for stderr test. Modified version information retrieval.
Diffstat (limited to 'test/git/test_git.py')
-rw-r--r-- | test/git/test_git.py | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/test/git/test_git.py b/test/git/test_git.py index c20ea7b5..e358d01b 100644 --- a/test/git/test_git.py +++ b/test/git/test_git.py @@ -1,7 +1,6 @@ import os from test.testlib import * -from git_python import Git -from git_python import errors +from git import Git, GitCommandError class TestGit(object): def setup(self): @@ -30,28 +29,24 @@ class TestGit(object): def test_it_accepts_stdin(self): filename = fixture_path("cat_file_blob") fh = open(filename, 'r') - assert_equal( "70c379b63ffa0795fdbfbc128e5a2818397b7ef8", - self.git.hash_object(istream=fh, stdin=True) ) + assert_equal("70c379b63ffa0795fdbfbc128e5a2818397b7ef8", + 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) ) + assert_equal((1, ""), self.git.this_does_not_exist(with_status=True)) + @raises(GitCommandError) 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 ) + self.git.this_does_not_exist(with_exceptions=True) 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) ) + 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_equal( "git: 'this-does-not-exist' is not a git-command. See 'git --help'." + os.linesep, + assert_match(r"^git: 'this-does-not-exist' is not a git-command" + os.linesep, self.git.this_does_not_exist(with_stderr=True, - with_raw_output=True) ) + with_raw_output=True)) |