#NEWLINE# @ mock . patch ( 'ironic.objects.Port.list_by_node_id' , spec_set = types . FunctionType ) #NEWLINE# @ mock . patch . object ( agent_client . AgentClient , 'execute_clean_step' , autospec = True ) #NEWLINE# def test_execute_clean_step_version_mismatch( self , client_mock , list_ports_mock ) : #NEWLINE# #INDENT# client_mock . return_value = { #NEWLINE# #INDENT# 'command_status' : 'RUNNING' , #NEWLINE# #UNINDENT# } #NEWLINE# list_ports_mock . return_value = self . ports #NEWLINE# with task_manager . acquire ( self . context , self . node . uuid , shared = False ) as task : #NEWLINE# #INDENT# response = utils . agent_execute_clean_step ( task , self . clean_steps [ 'deploy' ] [ 0 ] ) #NEWLINE# self . assertEqual ( states . CLEANWAIT , list_ports_mock )