summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-08 11:45:21 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-08 11:45:21 +0100
commitde4cfcc4a1fcb24b72a31c5feff8c67d2ff930fc (patch)
tree2ae34e0e2be837226bdbdb61dfd2d65b8c5a7616
parent987f9bbd08446de3f9d135659f2e36ad6c9d14fb (diff)
downloadgitpython-de4cfcc4a1fcb24b72a31c5feff8c67d2ff930fc.tar.gz
Added test to verify blame commits can have multiple lines.
See #47
-rw-r--r--git/test/test_repo.py8
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