diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 11:45:21 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 11:45:21 +0100 |
commit | de4cfcc4a1fcb24b72a31c5feff8c67d2ff930fc (patch) | |
tree | 2ae34e0e2be837226bdbdb61dfd2d65b8c5a7616 /git/test/test_repo.py | |
parent | 987f9bbd08446de3f9d135659f2e36ad6c9d14fb (diff) | |
download | gitpython-de4cfcc4a1fcb24b72a31c5feff8c67d2ff930fc.tar.gz |
Added test to verify blame commits can have multiple lines.
See #47
Diffstat (limited to 'git/test/test_repo.py')
-rw-r--r-- | git/test/test_repo.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/git/test/test_repo.py b/git/test/test_repo.py index e0be2074..9755ea1e 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -299,12 +299,16 @@ class TestRepo(TestBase): def test_blame_real(self): c = 0 + nml = 0 # amount of multi-lines per blame for item in self.rorepo.head.commit.tree.traverse( predicate=lambda i, d: i.type == 'blob' and i.path.endswith('.py')): c += 1 - self.rorepo.blame(self.rorepo.head, item.path) + + for b in self.rorepo.blame(self.rorepo.head, item.path): + nml += int(len(b[1]) > 1) # END for each item to traverse - assert c + assert c, "Should have executed at least one blame command" + assert nml, "There should at least be one blame commit that contains multiple lines" def test_untracked_files(self): base = self.rorepo.working_tree_dir |