Revision 7d368e73 snf-cyclades-app/synnefo/api/test/floating_ips.py

b/snf-cyclades-app/synnefo/api/test/floating_ips.py
118 118
        self.assertSuccess(response)
119 119
        ips_after = FloatingIP.objects.filter(id=ip.id)
120 120
        self.assertEqual(len(ips_after), 0)
121

  
122

  
123
POOLS_URL = "/api/v1.1/os-floating-ip-pools"
124

  
125

  
126
class FloatingIPPoolsAPITest(BaseAPITest):
127
    def test_no_pool(self):
128
        response = self.get(POOLS_URL)
129
        self.assertSuccess(response)
130
        self.assertEqual(json.loads(response.content)["floating_ip_pools"], [])
131

  
132
    def test_list_pools(self):
133
        net = NetworkFactory(public=True, deleted=False)
134
        NetworkFactory(public=True, deleted=True)
135
        NetworkFactory(public=False, deleted=False)
136
        response = self.get(POOLS_URL)
137
        self.assertSuccess(response)
138
        self.assertEqual(json.loads(response.content)["floating_ip_pools"],
139
                        [{"name": str(net.id)}])

Also available in: Unified diff