#NEWLINE# @ mock . patch . object ( conductor_utils , '_get_cleaning_steps' ) #NEWLINE# def test__validate_user_clean_steps_invalid_arg( self , mock_steps ) : #NEWLINE# #INDENT# node = obj_utils . create_test_node ( self . context ) #NEWLINE# mock_steps . return_value = self . clean_steps #NEWLINE# user_steps = [ { #NEWLINE# #INDENT# 'step' : 'update_firmware' , #NEWLINE# 'interface' : 'power' , #NEWLINE# 'args' : { #NEWLINE# #INDENT# 'arg1' : 'val1' , #NEWLINE# 'arg2' : 'val2' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'step' : 'erase_disks' , #NEWLINE# 'interface' : 'deploy' , #NEWLINE# #UNINDENT# } ] #NEWLINE# with task_manager . acquire ( self . context , self . uuid ) as task : #NEWLINE# #INDENT# self . assertRaisesRegexp ( exception . InvalidParameterValue , 'update_firmware.*invalid.*arg1' , conductor_utils . _validate_user_clean_steps , task , user_steps ) #NEWLINE# mock_steps . assert_called_once_with ( task , enabled = False , sort = False )