@@ -423,25 +423,26 @@ def test__prepare_initiate_request_bad_stream_position(self):
423423 with pytest .raises (AttributeError ):
424424 upload ._prepare_initiate_request (None , {}, BASIC_CONTENT )
425425
426- def test__process_initiate_response_bad_response (self ):
426+ def test__process_initiate_response_non_200 (self ):
427427 upload = _upload .ResumableUpload (RESUMABLE_URL , ONE_MB )
428428 _fix_up_virtual (upload )
429429
430- response = _make_response ()
430+ response = _make_response (403 )
431431 with pytest .raises (common .InvalidResponse ) as exc_info :
432432 upload ._process_initiate_response (response )
433433
434434 error = exc_info .value
435435 assert error .response is response
436- assert len (error .args ) == 2
437- assert error .args [1 ] == u'location'
436+ assert len (error .args ) == 4
437+ assert error .args [1 ] == 403
438+ assert error .args [3 ] == 200
438439
439440 def test__process_initiate_response (self ):
440441 upload = _upload .ResumableUpload (RESUMABLE_URL , ONE_MB )
441442 _fix_up_virtual (upload )
442443
443444 headers = {u'location' : u'http://test.invalid?upload_id=kmfeij3234' }
444- response = mock . Mock (headers = headers , spec = [ u'headers' ] )
445+ response = _make_response (headers = headers )
445446 # Check resumable_url before.
446447 assert upload ._resumable_url is None
447448 # Process the actual headers.
0 commit comments