diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-28 22:25:12 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-28 22:25:12 +0200 |
commit | f1401803ccf7db5d897a5ef4b27e2176627c430e (patch) | |
tree | 85800758d4525fb90c7e84f10852290deb49986e /test/git/performance/test_streams.py | |
parent | 8d2239f24f6a54d98201413d4f46256df0d6a5f3 (diff) | |
download | gitpython-f1401803ccf7db5d897a5ef4b27e2176627c430e.tar.gz |
Fixed performance tests which broke in the course of the sha1-20 byte changes
Diffstat (limited to 'test/git/performance/test_streams.py')
-rw-r--r-- | test/git/performance/test_streams.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/git/performance/test_streams.py b/test/git/performance/test_streams.py index 36d0d29c..ec061ece 100644 --- a/test/git/performance/test_streams.py +++ b/test/git/performance/test_streams.py @@ -2,6 +2,7 @@ from test.testlib import * from gitdb import * +from gitdb.util import bin_to_hex from time import time import os @@ -37,10 +38,10 @@ class TestObjDBPerformance(TestBigRepoR): # writing - due to the compression it will seem faster than it is st = time() - sha = ldb.store(IStream('blob', size, stream)).sha + binsha = ldb.store(IStream('blob', size, stream)).binsha elapsed_add = time() - st - assert ldb.has_object(sha) - db_file = ldb.readable_db_object_path(sha) + assert ldb.has_object(binsha) + db_file = ldb.readable_db_object_path(bin_to_hex(binsha)) fsize_kib = os.path.getsize(db_file) / 1000 @@ -49,7 +50,7 @@ class TestObjDBPerformance(TestBigRepoR): # reading all at once st = time() - ostream = ldb.stream(sha) + ostream = ldb.stream(binsha) shadata = ostream.read() elapsed_readall = time() - st @@ -62,7 +63,7 @@ class TestObjDBPerformance(TestBigRepoR): cs = 512*1000 chunks = list() st = time() - ostream = ldb.stream(sha) + ostream = ldb.stream(binsha) while True: data = ostream.read(cs) chunks.append(data) @@ -94,7 +95,7 @@ class TestObjDBPerformance(TestBigRepoR): proc.wait() gelapsed_add = time() - st del(data) - assert gitsha == sha # we do it the same way, right ? + assert gitsha == bin_to_hex(binsha) # we do it the same way, right ? # as its the same sha, we reuse our path fsize_kib = os.path.getsize(db_file) / 1000 |