#NEWLINE# def test_handle_upload_object_head_first_missing( self ) : #NEWLINE# #INDENT# object_name = '/foo/bar/SP000001' #NEWLINE# object_info = { #NEWLINE# #INDENT# 'type' : ssbench . CREATE_OBJECT , #NEWLINE# 'container' : 'Picture' , #NEWLINE# 'name' : object_name , #NEWLINE# 'size' : 99000 , #NEWLINE# 'head_first' : True , #NEWLINE# 'block_size' : None , #NEWLINE# 'delete_after' : None , #NEWLINE# #UNINDENT# } #NEWLINE# self . mock_worker . should_receive ( 'ignoring_http_responses' ) . with_args ( ( 503 , ) , client . head_object , object_info ) . and_raise ( client . ClientException ( 'oh noes!' ) ) . once #NEWLINE# self . mock_worker . should_receive ( 'ignoring_http_responses' ) . with_args ( ( 503 , ) , client . put_object , object_info , content_length = 99000 , chunk_size = worker . DEFAULT_BLOCK_SIZE , contents = ( 'A' * worker . DEFAULT_BLOCK_SIZE ) , headers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) . and_return ( { #NEWLINE# #INDENT# 'x-swiftstack-first-byte-latency' : 0.3248 , #NEWLINE# 'x-swiftstack-last-byte-latency' : 4.493 , #NEWLINE# 'x-trans-id' : 'evn' , #NEWLINE# 'retries' : 0 , #NEWLINE# #UNINDENT# } ) . once #NEWLINE# self . time_expectation . once #NEWLINE# exp_put = add_dicts ( object_info , worker_id = self . worker_id , first_byte_latency = 0.3248 , last_byte_latency = 4.493 , trans_id = 'evn' , completed_at = self . stub_time , retries = 0 ) #NEWLINE# exp_put . pop ( 'head_first' ) #NEWLINE# exp_put . pop ( 'block_size' ) #NEWLINE# self . result_queue . should_receive ( 'put' ) . with_args ( exp_put ) . once #NEWLINE# self . mock_worker . handle_upload_object ( object_info )