#NEWLINE# @ mock . patch . object ( conductor_utils , '_validate_user_clean_steps' ) #NEWLINE# @ mock . patch . object ( conductor_utils , '_get_cleaning_steps' ) #NEWLINE# def test_set_node_cleaning_steps_automated( self , mock_steps , mock_validate_user_steps ) : #NEWLINE# #INDENT# mock_steps . return_value = self . clean_steps #NEWLINE# node = obj_utils . create_test_node ( self . context , driver = 'fake' , provision_state = states . CLEANING , target_provision_state = states . AVAILABLE , last_error = None , clean_step = None ) #NEWLINE# with task_manager . acquire ( self . context , node . uuid , shared = False ) as task : #NEWLINE# #INDENT# conductor_utils . set_node_cleaning_steps ( task ) #NEWLINE# node . refresh ( ) #NEWLINE# self . assertEqual ( self . clean_steps , node . driver_internal_info [ 'clean_steps' ] ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , node . clean_step ) #NEWLINE# mock_steps . assert_called_once_with ( task , enabled = True ) #NEWLINE# self . assertFalse ( mock_validate_user_steps . called )