File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,6 @@ def _write_to_stream(self, response):
387387 msg += content_length_msg
388388 raise DataCorruption (response , msg )
389389
390-
391390 def consume (
392391 self ,
393392 transport ,
Original file line number Diff line number Diff line change @@ -477,7 +477,7 @@ def write(self, b):
477477 self ._buffer .seek (0 , io .SEEK_END )
478478 pos = self ._buffer .write (b )
479479 self ._buffer .seek (bookmark )
480- return self . _cursor + pos
480+ return pos
481481
482482 def read (self , size = - 1 ):
483483 """Read and move the cursor."""
Original file line number Diff line number Diff line change @@ -367,12 +367,14 @@ def test_write(self, mock_warn):
367367
368368 # Write under chunk_size. This should be buffered and the upload not
369369 # initiated.
370- writer .write (TEST_BINARY_DATA [0 :4 ])
370+ w1 = writer .write (TEST_BINARY_DATA [0 :4 ])
371+ self .assertEqual (w1 , 4 )
371372 blob ._initiate_resumable_upload .assert_not_called ()
372373
373374 # Write over chunk_size. This should result in upload initialization
374375 # and multiple chunks uploaded.
375- writer .write (TEST_BINARY_DATA [4 :32 ])
376+ w2 = writer .write (TEST_BINARY_DATA [4 :32 ])
377+ self .assertEqual (w2 , 28 )
376378 blob ._initiate_resumable_upload .assert_called_once_with (
377379 blob .bucket .client ,
378380 writer ._buffer ,
You can’t perform that action at this time.
0 commit comments