#NEWLINE# def test_monitor_will_add_new_workers_when_it_finished_scaling_and_it_needs_new_workers( self ) : #NEWLINE# #INDENT# messages = [ createWorkerStatusMessage ( 'tcp://127.0.0.1:1' , 'en-GB' , 'WORKING' , 1 ) . SerializeToString ( ) , createWorkerStatusMessage ( 'tcp://127.0.0.1:1' , 'en-GB' , 'WORKING' , 2 ) . SerializeToString ( ) , createWorkerStatusMessage ( 'tcp://127.0.0.1:2' , 'en-GB' , 'STARTED' , 3 ) . SerializeToString ( ) , createWorkerStatusMessage ( 'tcp://127.0.0.1:1' , 'en-GB' , 'WORKING' , 4 ) . SerializeToString ( ) , createWorkerStatusMessage ( 'tcp://127.0.0.1:2' , 'en-GB' , 'WORKING' , 5 ) . SerializeToString ( ) ] #NEWLINE# self . run_monitor ( messages ) #NEWLINE# expected_messages = [ { #NEWLINE# #INDENT# 'en-GB' : ( + 1 ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'en-GB' : ( + 1 ) , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . assertEqual ( messages , self . scale_workers . scaling_history )