

def test_group_by_network_id(self):
    port1 = {
        'network_id': 'a',
    }
    port2 = {
        'network_id': 'b',
    }
    port3 = {
        'network_id': 'a',
    }
    grouped_ports = self.callbacks._group_by_network_id([port1, port2, port3])
    expected = {
        'a': [port1, port3],
        'b': [port2],
    }
    self.assertEqual(expected, grouped_ports)

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