

def _test_floating_ip_get_associated(self, assoc_port, exp_instance_type):
    fip = self.api_q_floating_ips.list()[1]
    self.qclient.show_floatingip(fip['id']).AndReturn({
        'floatingip': fip,
    })
    self.qclient.show_port(assoc_port['id']).AndReturn({
        'port': assoc_port,
    })
    self.mox.ReplayAll()
    ret = api.network.tenant_floating_ip_get(self.request, fip['id'])
    for attr in ['id', 'ip', 'pool', 'fixed_ip', 'port_id']:
        self.assertEqual(fip[attr], getattr(ret, attr))
    self.assertEqual(assoc_port['device_id'], ret.instance_id)
    self.assertEqual(exp_instance_type, ret.instance_type)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/test/api_tests/network_tests.py NetworkApiNeutronFloatingIpTests._test_floating_ip_get_associated/original