#NEWLINE# def test_worker_cant_be_assigned_to_another_client_before_finishing_its_task( self ) : #NEWLINE# #INDENT# messages = [ { #NEWLINE# #INDENT# 'worker' : self . make_heartbeat_request ( 'tcp://127.0.0.1:1' , 'en-GB' , 'STARTED' ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'frontend' : self . make_frontend_request ( ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'worker' : self . make_heartbeat_request ( 'tcp://127.0.0.1:1' , 'en-GB' , 'WORKING' ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'frontend' : self . make_frontend_request ( ) , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . run_master ( messages ) #NEWLINE# expected_message1 = self . make_frontend_successfull_response ( 'tcp://127.0.0.1:1' ) #NEWLINE# expected_message2 = self . make_frontend_error_response ( 'No worker available' ) #NEWLINE# self . assertThatMessagesWereSendToFrontend ( [ expected_message1 , expected_message2 ] )