22
33from test .testlib import *
44from gitdb import *
5+ from gitdb .util import bin_to_hex
56
67from time import time
78import os
@@ -37,10 +38,10 @@ def test_large_data_streaming(self, rwrepo):
3738
3839 # writing - due to the compression it will seem faster than it is
3940 st = time ()
40- sha = ldb .store (IStream ('blob' , size , stream )).sha
41+ binsha = ldb .store (IStream ('blob' , size , stream )).binsha
4142 elapsed_add = time () - st
42- assert ldb .has_object (sha )
43- db_file = ldb .readable_db_object_path (sha )
43+ assert ldb .has_object (binsha )
44+ db_file = ldb .readable_db_object_path (bin_to_hex ( binsha ) )
4445 fsize_kib = os .path .getsize (db_file ) / 1000
4546
4647
@@ -49,7 +50,7 @@ def test_large_data_streaming(self, rwrepo):
4950
5051 # reading all at once
5152 st = time ()
52- ostream = ldb .stream (sha )
53+ ostream = ldb .stream (binsha )
5354 shadata = ostream .read ()
5455 elapsed_readall = time () - st
5556
@@ -62,7 +63,7 @@ def test_large_data_streaming(self, rwrepo):
6263 cs = 512 * 1000
6364 chunks = list ()
6465 st = time ()
65- ostream = ldb .stream (sha )
66+ ostream = ldb .stream (binsha )
6667 while True :
6768 data = ostream .read (cs )
6869 chunks .append (data )
@@ -94,7 +95,7 @@ def test_large_data_streaming(self, rwrepo):
9495 proc .wait ()
9596 gelapsed_add = time () - st
9697 del (data )
97- assert gitsha == sha # we do it the same way, right ?
98+ assert gitsha == bin_to_hex ( binsha ) # we do it the same way, right ?
9899
99100 # as its the same sha, we reuse our path
100101 fsize_kib = os .path .getsize (db_file ) / 1000
0 commit comments