@@ -346,6 +346,7 @@ def test_write(self, mock_warn):
346
346
blob = mock .Mock ()
347
347
upload = mock .Mock ()
348
348
transport = mock .Mock ()
349
+ timeout = 600
349
350
350
351
blob ._initiate_resumable_upload .return_value = (upload , transport )
351
352
@@ -354,7 +355,10 @@ def test_write(self, mock_warn):
354
355
# arguments are used.
355
356
# It would be normal to use a context manager here, but not doing so
356
357
# gives us more control over close() for test purposes.
357
- upload_kwargs = {"if_metageneration_match" : 1 }
358
+ upload_kwargs = {
359
+ "if_metageneration_match" : 1 ,
360
+ "timeout" : timeout ,
361
+ }
358
362
chunk_size = 8 # Note: Real upload requires a multiple of 256KiB.
359
363
writer = self ._make_blob_writer (
360
364
blob ,
@@ -366,7 +370,7 @@ def test_write(self, mock_warn):
366
370
367
371
# The transmit_next_chunk method must actually consume bytes from the
368
372
# sliding buffer for the flush() feature to work properly.
369
- upload .transmit_next_chunk .side_effect = lambda _ : writer ._buffer .read (
373
+ upload .transmit_next_chunk .side_effect = lambda _ , timeout : writer ._buffer .read (
370
374
chunk_size
371
375
)
372
376
@@ -388,7 +392,7 @@ def test_write(self, mock_warn):
388
392
retry = None ,
389
393
** upload_kwargs
390
394
)
391
- upload .transmit_next_chunk .assert_called_with (transport )
395
+ upload .transmit_next_chunk .assert_called_with (transport , timeout = timeout )
392
396
self .assertEqual (upload .transmit_next_chunk .call_count , 4 )
393
397
394
398
# Write another byte, finalize and close.
0 commit comments