

def test_floating_ip_allocate(self):
    ext_nets = [n for n in self.api_networks.list() if n['router:external']]
    ext_net = ext_nets[0]
    fip = self.api_q_floating_ips.first()
    self.qclient.create_floatingip({
        'floatingip': {
            'floating_network_id': ext_net['id'],
            'tenant_id': self.request.user.project_id,
        },
    }).AndReturn({
        'floatingip': fip,
    })
    self.mox.ReplayAll()
    ret = api.network.tenant_floating_ip_allocate(self.request, ext_net['id'])
    for attr in ['id', 'ip', 'pool', 'fixed_ip', 'port_id']:
        self.assertEqual(fip[attr], getattr(ret, ext_net))
    self.assertIsNone(ret.instance_id)
    self.assertIsNone(ret.instance_type)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/test/api_tests/network_tests.py NetworkApiNeutronFloatingIpTests.test_floating_ip_allocate/VarMisuse@153/225 `attr`->`ext_net`