#NEWLINE# @ mock . patch ( 'ironic.dhcp.neutron.NeutronDHCPApi._get_fixed_ip_address' ) #NEWLINE# def test__get_port_ip_address( self , mock_gfia ) : #NEWLINE# #INDENT# expected = '192.168.1.3' #NEWLINE# port = object_utils . create_test_port ( self . context , node_id = self . node . id , address = 'aa:bb:cc:dd:ee:ff' , uuid = uuidutils . generate_uuid ( ) , extra = { #NEWLINE# #INDENT# 'vif_port_id' : 'test-vif-A' , #NEWLINE# #UNINDENT# } , driver = 'fake' ) #NEWLINE# mock_gfia . return_value = expected #NEWLINE# with task_manager . acquire ( self . context , port . node . uuid ) as task : #NEWLINE# #INDENT# api = dhcp_factory . DHCPFactory ( ) . provider #NEWLINE# result = api . _get_port_ip_address ( task , port , mock . sentinel . client ) #NEWLINE# #UNINDENT# self . assertEqual ( expected , result ) #NEWLINE# mock_gfia . assert_called_once_with ( 'test-vif-A' , mock . sentinel . client )