#NEWLINE# def test_when_worker_is_finished_master_informs_monitor_that_the_worker_is_waiting( self ) : #NEWLINE# #INDENT# messages = [ { #NEWLINE# #INDENT# 'worker' : self . make_heartbeat_request ( 'tcp://127.0.0.1:1' , 'en-GB' , 'WAITING' ) , #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' , 'FINISHED' ) , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . run_master ( expected_message3 ) #NEWLINE# expected_message1 = self . make_worker_status_message ( 'tcp://127.0.0.1:1' , 'en-GB' , 'STARTED' , 1 ) #NEWLINE# expected_message2 = self . make_worker_status_message ( 'tcp://127.0.0.1:1' , 'en-GB' , 'WORKING' , 2 ) #NEWLINE# expected_message3 = self . make_worker_status_message ( 'tcp://127.0.0.1:1' , 'en-GB' , 'WAITING' , 3 ) #NEWLINE# self . assertThatMessagesWereSendToMonitor ( [ expected_message1 , expected_message2 , expected_message3 ] )