#NEWLINE# @ mock . patch . object ( FAKE_CLIENT . port , 'update' ) #NEWLINE# @ mock . patch . object ( FAKE_CLIENT , 'node' ) #NEWLINE# def test_unplug_vifs_port_not_associated( self , mock_node , mock_update ) : #NEWLINE# #INDENT# node_uuid = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' #NEWLINE# node = ironic_utils . get_test_node ( uuid = node_uuid ) #NEWLINE# port = ironic_utils . get_test_port ( extra = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# mock_node . get . return_value = node #NEWLINE# mock_node . list_ports . return_value = [ port ] #NEWLINE# instance = fake_instance . fake_instance_obj ( self . ctx , node = node_uuid ) #NEWLINE# self . driver . unplug_vifs ( port , utils . get_test_network_info ( ) ) #NEWLINE# mock_node . get . assert_called_once_with ( node_uuid , fields = ironic_driver . _NODE_FIELDS ) #NEWLINE# mock_node . list_ports . assert_called_once_with ( node_uuid , detail = True ) #NEWLINE# self . assertFalse ( mock_update . called )