#NEWLINE# @ mock . patch . object ( FAKE_CLIENT , 'node' ) #NEWLINE# def test_destroy_unassociate_fail( self , mock_node ) : #NEWLINE# #INDENT# node_uuid = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' #NEWLINE# node = ironic_utils . get_test_node ( driver = 'fake' , uuid = node_uuid , provision_state = ironic_states . ACTIVE ) #NEWLINE# instance = fake_instance . fake_instance_obj ( self . ctx , node = node_uuid ) #NEWLINE# mock_node . get_by_instance_uuid . return_value = node #NEWLINE# mock_node . update . side_effect = exception . NovaException ( ) #NEWLINE# self . assertRaises ( exception . NovaException , self . driver . destroy , self . ctx , instance , None , None ) #NEWLINE# mock_node . set_provision_state . assert_called_once_with ( node_uuid , 'deleted' ) #NEWLINE# mock_node . get_by_instance_uuid . assert_called_with ( instance . uuid , fields = ironic_driver . _NODE_FIELDS )