@@ -41,15 +41,15 @@ def _assert_object_writing_simple(self, db):
4141 istream = IStream (str_blob_type , len (data ), StringIO (data ))
4242 new_istream = db .store (istream )
4343 assert new_istream is istream
44- assert db .has_object (istream .sha )
44+ assert db .has_object (istream .binsha )
4545
46- info = db .info (istream .sha )
46+ info = db .info (istream .binsha )
4747 assert isinstance (info , OInfo )
4848 assert info .type == istream .type and info .size == istream .size
4949
50- stream = db .stream (istream .sha )
50+ stream = db .stream (istream .binsha )
5151 assert isinstance (stream , OStream )
52- assert stream .sha == info .sha and stream .type == info .type
52+ assert stream .binsha == info .binsha and stream .type == info .type
5353 assert stream .read () == data
5454 # END for each item
5555
@@ -80,10 +80,10 @@ def _assert_object_writing(self, db):
8080
8181 # store returns same istream instance, with new sha set
8282 my_istream = db .store (istream )
83- sha = istream .sha
83+ sha = istream .binsha
8484 assert my_istream is istream
8585 assert db .has_object (sha ) != dry_run
86- assert len (sha ) == 40 # for now we require 40 byte shas as default
86+ assert len (sha ) == 20
8787
8888 # verify data - the slow way, we want to run code
8989 if not dry_run :
@@ -107,12 +107,12 @@ def _assert_object_writing(self, db):
107107 # identical to what we fed in
108108 ostream .seek (0 )
109109 istream .stream = ostream
110- assert istream .sha is not None
111- prev_sha = istream .sha
110+ assert istream .binsha is not None
111+ prev_sha = istream .binsha
112112
113113 db .set_ostream (ZippedStoreShaWriter ())
114114 db .store (istream )
115- assert istream .sha == prev_sha
115+ assert istream .binsha == prev_sha
116116 new_ostream = db .ostream ()
117117
118118 # note: only works as long our store write uses the same compression
@@ -143,12 +143,12 @@ def istream_generator(offset=0, ni=ni):
143143
144144 for stream in istreams :
145145 assert stream .error is None
146- assert len (stream .sha ) == 40
146+ assert len (stream .binsha ) == 20
147147 assert isinstance (stream , IStream )
148148 # END assert each stream
149149
150150 # test has-object-async - we must have all previously added ones
151- reader = IteratorReader ( istream .sha for istream in istreams )
151+ reader = IteratorReader ( istream .binsha for istream in istreams )
152152 hasobject_reader = db .has_object_async (reader )
153153 count = 0
154154 for sha , has_object in hasobject_reader :
@@ -158,7 +158,7 @@ def istream_generator(offset=0, ni=ni):
158158 assert count == ni
159159
160160 # read the objects we have just written
161- reader = IteratorReader ( istream .sha for istream in istreams )
161+ reader = IteratorReader ( istream .binsha for istream in istreams )
162162 ostream_reader = db .stream_async (reader )
163163
164164 # read items individually to prevent hitting possible sys-limits
@@ -171,7 +171,7 @@ def istream_generator(offset=0, ni=ni):
171171 assert count == ni
172172
173173 # get info about our items
174- reader = IteratorReader ( istream .sha for istream in istreams )
174+ reader = IteratorReader ( istream .binsha for istream in istreams )
175175 info_reader = db .info_async (reader )
176176
177177 count = 0
@@ -186,7 +186,7 @@ def istream_generator(offset=0, ni=ni):
186186 # add 2500 items, and obtain their output streams
187187 nni = 2500
188188 reader = IteratorReader (istream_generator (offset = ni , ni = nni ))
189- istream_to_sha = lambda istreams : [ istream .sha for istream in istreams ]
189+ istream_to_sha = lambda istreams : [ istream .binsha for istream in istreams ]
190190
191191 istream_reader = db .store_async (reader )
192192 istream_reader .set_post_cb (istream_to_sha )
0 commit comments