#NEWLINE# @ mock . patch . object ( FAKE_CLIENT . node , 'set_provision_state' ) #NEWLINE# @ mock . patch . object ( ironic_driver . IronicDriver , '_validate_instance_and_node' ) #NEWLINE# def test__unprovision_instance_not_found( self , mock_validate_inst , mock_set_pstate ) : #NEWLINE# #INDENT# node = ironic_utils . get_test_node ( driver = 'fake' , provision_state = ironic_states . DELETING ) #NEWLINE# instance = fake_instance . fake_instance_obj ( self . ctx , node = node . uuid ) #NEWLINE# mock_validate_inst . side_effect = exception . InstanceNotFound ( instance_id = 'fake' ) #NEWLINE# self . driver . _unprovision ( instance , mock_validate_inst ) #NEWLINE# mock_validate_inst . assert_called_once_with ( instance ) #NEWLINE# mock_set_pstate . assert_called_once_with ( node . uuid , 'deleted' )