

def test_update_dhcp_port(self):
    port = {
        'port': {
            'network_id': 'foo_network_id',
            'device_owner': constants.DEVICE_OWNER_DHCP,
            'fixed_ips': [{
                'subnet_id': 'foo_subnet_id',
            }],
        },
    }
    expected_port = {
        'port': {
            'network_id': 'foo_network_id',
            'device_owner': constants.DEVICE_OWNER_DHCP,
            portbindings.HOST_ID: 'foo_host',
            'fixed_ips': [{
                'subnet_id': 'foo_subnet_id',
            }],
        },
        'id': 'foo_port_id',
    }
    self.plugin.get_port.return_value = {
        'device_id': n_const.DEVICE_ID_RESERVED_DHCP_PORT,
    }
    self.callbacks.update_dhcp_port(mock.Mock(), host='foo_host', port_id='foo_port_id', port=port)
    self.plugin.assert_has_calls([mock.call.update_port(mock.ANY, 'foo_port_id', expected_port)])

dataset/ETHPy150Open openstack/neutron/neutron/tests/unit/api/rpc/handlers/test_dhcp_rpc.py TestDhcpRpcCallback.test_update_dhcp_port/original