diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-21 18:56:29 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-21 18:57:34 +0100 |
commit | d565a874f29701531ce1fc0779592838040d3edf (patch) | |
tree | c2ba9a69ae90eedc01616b409a179baf705a3feb /git/test/test_index.py | |
parent | e4d3809161fc54d6913c0c2c7f6a7b51eebe223f (diff) | |
download | gitpython-d565a874f29701531ce1fc0779592838040d3edf.tar.gz |
Fixed regression in test-suite for IndexFile
Previously, it checked for AssertionErrors, now we have to implement
need-unbare-repo check ourselves.
Diffstat (limited to 'git/test/test_index.py')
-rw-r--r-- | git/test/test_index.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/git/test/test_index.py b/git/test/test_index.py index 0569f40f..63f99f10 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -12,7 +12,10 @@ from git.test.lib import ( with_rw_repo ) from git.util import Actor -from git.exc import HookExecutionError +from git.exc import ( + HookExecutionError, + InvalidGitRepositoryError +) from git import ( IndexFile, BlobFilter, @@ -740,7 +743,8 @@ class TestIndex(TestBase): # property rw_bare_repo.working_tree_dir will return '/tmp' # instead of throwing the Exception we are expecting. This is # a quick hack to make this test fail when expected. - rw_bare_repo._working_tree_dir = None + assert rw_bare_repo.working_tree_dir is None + assert rw_bare_repo.bare contents = b'This is a BytesIO file' filesize = len(contents) fileobj = BytesIO(contents) @@ -758,6 +762,6 @@ class TestIndex(TestBase): path = os.path.join('git', 'test', 'test_index.py') try: rw_bare_repo.index.add([path]) - except Exception as e: - asserted = "does not have a working tree" in str(e) + except InvalidGitRepositoryError: + asserted = True assert asserted, "Adding using a filename is not correctly asserted." |