#NEWLINE# def test_when_worker_receives_chunk_with_bad_id_it_should_return_error_message( self ) : #NEWLINE# #INDENT# messages = [ { #NEWLINE# #INDENT# 'frontend' : self . make_frontend_request ( 'message 1' , 'ONLINE' , has_next = True , id = 1 ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'frontend' : self . make_frontend_request ( 'message 2' , 'ONLINE' , has_next = True , id = 2 ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'frontend' : self . make_frontend_request ( 'message 1' , 'ONLINE' , has_next = False , id = 1 ) , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . run_worker ( messages ) #NEWLINE# expected_message1 = createResultsMessage ( [ ( 0 , False , [ ( 1.0 , 'Interim result' ) ] ) ] ) #NEWLINE# expected_message2 = createErrorResultsMessage ( ) #NEWLINE# expected_message3 = createResultsMessage ( [ ( 0 , True , [ ( 1.0 , 'Hello World!' ) ] ) ] ) #NEWLINE# self . assertThatMessagesWereSendToFrontend ( [ expected_message1 , expected_message3 , expected_message3 ] )