Skip to content

Commit

Permalink
Added test to verify blame commits can have multiple lines.
Browse files Browse the repository at this point in the history
See #47
  • Loading branch information
Byron committed Jan 8, 2015
1 parent 987f9bb commit de4cfcc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git/test/test_repo.py
Expand Up @@ -299,12 +299,16 @@ def test_should_display_blame_information(self, git):

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
Expand Down

0 comments on commit de4cfcc

Please sign in to comment.