#NEWLINE# def test_cleaning_error_handler( self ) : #NEWLINE# #INDENT# self . node . provision_state = states . CLEANING #NEWLINE# target = 'baz' #NEWLINE# self . node . target_provision_state = target #NEWLINE# self . node . driver_internal_info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# msg = 'error bar' #NEWLINE# conductor_utils . cleaning_error_handler ( self . task , msg ) #NEWLINE# self . node . save . assert_called_once_with ( ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , self . node . clean_step ) #NEWLINE# self . assertFalse ( ( 'clean_step_index' in self . node . driver_internal_info ) ) #NEWLINE# self . assertEqual ( msg , self . node . last_error ) #NEWLINE# self . assertTrue ( self . node . maintenance ) #NEWLINE# self . assertEqual ( msg , self . node . maintenance_reason ) #NEWLINE# driver = self . task . driver . deploy #NEWLINE# driver . tear_down_cleaning . assert_called_once_with ( self . task ) #NEWLINE# self . task . process_event . assert_called_once_with ( 'fail' , target_state = None )