

def test_release_dhcp_port(self):
    port_retval = dict(id='port_id', fixed_ips=[dict(subnet_id='a')])
    self.plugin.get_ports.return_value = [port_retval]
    self.callbacks.release_dhcp_port(mock.ANY, network_id='netid', device_id='devid')
    self.plugin.assert_has_calls([mock.call.delete_ports_by_device_id(mock.ANY, 'devid', 'netid')])

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