

def test_server_security_groups(self):
    cur_sg_ids = [sg['id'] for sg in self.api_q_secgroups.list()[:2]]
    (instance_id, instance_ports) = self._get_instance(cur_sg_ids)
    self.qclient.list_ports(device_id=instance_id).AndReturn({
        'ports': instance_ports,
    })
    secgroups = copy.deepcopy(self.api_q_secgroups.list())
    self.qclient.list_security_groups(id=set(cur_sg_ids)).AndReturn({
        'security_groups': secgroups,
    })
    self.mox.ReplayAll()
    api.network.server_security_groups(self.request, instance_id)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/test/api_tests/network_tests.py NetworkApiNeutronSecurityGroupTests.test_server_security_groups/original