summaryrefslogtreecommitdiff
path: root/test/git/test_blob.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-08 10:10:08 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-08 10:10:08 +0200
commit13ba1d87ab8fc45d2aed25662bf91053b0db5f9f (patch)
treefb48671b0ea8cff7b51176a7474b89a787d5528c /test/git/test_blob.py
parent75c161cbc017a7d176dd0d7b937db26b3ce637a1 (diff)
downloadgitpython-13ba1d87ab8fc45d2aed25662bf91053b0db5f9f.tar.gz
Fixed git.blob.Blob.blame function which would return the text-per-commit as individual characters
Diffstat (limited to 'test/git/test_blob.py')
-rw-r--r--test/git/test_blob.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/git/test_blob.py b/test/git/test_blob.py
index 8f83f391..5bd74ff7 100644
--- a/test/git/test_blob.py
+++ b/test/git/test_blob.py
@@ -69,6 +69,7 @@ class TestBlob(object):
git.return_value = fixture('blame')
b = Blob.blame(self.repo, 'master', 'lib/git.py')
assert_equal(13, len(b))
+ assert_equal( 2, len(b[0]) )
# assert_equal(25, reduce(lambda acc, x: acc + len(x[-1]), b))
assert_equal(hash(b[0][0]), hash(b[9][0]))
c = b[0][0]
@@ -83,6 +84,13 @@ class TestBlob(object):
assert_equal('tom@mojombo.com', c.committer.email)
assert_equal(time.gmtime(1191997100), c.committed_date)
assert_equal('initial grit setup', c.message)
+
+ # test the 'lines per commit' entries
+ tlist = b[0][1]
+ assert_true( tlist )
+ assert_true( isinstance( tlist[0], basestring ) )
+ assert_true( len( tlist ) < sum( len(t) for t in tlist ) ) # test for single-char bug
+
def test_should_return_appropriate_representation(self):
blob = Blob(self.repo, **{'id': 'abc'})