#NEWLINE# @ mock . patch . object ( conductor_utils , 'LOG' ) #NEWLINE# def test_provision_error_handler_no_worker( self , log_mock ) : #NEWLINE# #INDENT# exc = exception . NoFreeConductorWorker ( ) #NEWLINE# conductor_utils . provisioning_error_handler ( exc , self . node , 'state-one' , 'state-two' ) #NEWLINE# self . node . save . assert_called_once_with ( ) #NEWLINE# self . assertEqual ( 'state-one' , self . node . provision_state ) #NEWLINE# self . assertEqual ( 'state-two' , self . node . target_provision_state ) #NEWLINE# self . assertIn ( 'No free conductor workers' , self . node . last_error ) #NEWLINE# self . assertTrue ( log_mock . warning . called )