Skip to content

Commit de4cfcc

Browse files
committed
Added test to verify blame commits can have multiple lines.
See #47
1 parent 987f9bb commit de4cfcc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

git/test/test_repo.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,16 @@ def test_should_display_blame_information(self, git):
299299

300300
def test_blame_real(self):
301301
c = 0
302+
nml = 0 # amount of multi-lines per blame
302303
for item in self.rorepo.head.commit.tree.traverse(
303304
predicate=lambda i, d: i.type == 'blob' and i.path.endswith('.py')):
304305
c += 1
305-
self.rorepo.blame(self.rorepo.head, item.path)
306+
307+
for b in self.rorepo.blame(self.rorepo.head, item.path):
308+
nml += int(len(b[1]) > 1)
306309
# END for each item to traverse
307-
assert c
310+
assert c, "Should have executed at least one blame command"
311+
assert nml, "There should at least be one blame commit that contains multiple lines"
308312

309313
def test_untracked_files(self):
310314
base = self.rorepo.working_tree_dir

0 commit comments

Comments
 (0)