Skip to content

Commit 8b49396

Browse files
committedJan 1, 2015
Improved decompression test to scan the entire git repository, instead of just packs
This should make it easier to assert the issue is truly fixed now [skip ci]
1 parent 9e85a45 commit 8b49396

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎gitdb/test/performance/test_pack.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from gitdb import (
1313
MemoryDB,
14+
GitDB,
1415
IStream,
1516
)
1617
from gitdb.typ import str_blob_type
@@ -83,7 +84,8 @@ def test_loose_correctness(self):
8384
faster
8485
:note: It doesn't seem this test can find the issue unless the given pack contains highly compressed
8586
data files, like archives."""
86-
pdb = PackedDB(os.path.join(self.gitrepopath, "objects/pack"))
87+
from gitdb.util import bin_to_hex
88+
pdb = GitDB(os.path.join(self.gitrepopath, 'objects'))
8789
mdb = MemoryDB()
8890
for c, sha in enumerate(pdb.sha_iter()):
8991
ostream = pdb.stream(sha)
@@ -92,7 +94,7 @@ def test_loose_correctness(self):
9294
continue
9395
istream = IStream(ostream.type, ostream.size, ostream.stream)
9496
mdb.store(istream)
95-
assert istream.binsha == sha
97+
assert istream.binsha == sha, "Failed on object %s" % bin_to_hex(sha).decode('ascii')
9698
# this can fail ... sometimes, so the packs dataset should be huge
9799
assert len(mdb.stream(sha).read()) == ostream.size
98100

0 commit comments

Comments
 (0)
Please sign in to comment.