Revision 0a62912d
b/kamaki/clients/compute/rest_api.py | ||
---|---|---|
237 | 237 |
|
238 | 238 |
path = path4url('images', image_id, command) |
239 | 239 |
return self.put(path, data=data, success=success, **kwargs) |
240 |
|
|
241 |
def floating_ip_pools_get(self, tenant_id, success=200, **kwargs): |
|
242 |
path = path4url(tenant_id, 'os-floating-ip-pools') |
|
243 |
return self.get(path, success=success, **kwargs) |
b/kamaki/clients/compute/test.py | ||
---|---|---|
227 | 227 |
def test_images_put(self): |
228 | 228 |
self._test_put('images') |
229 | 229 |
|
230 |
@patch('%s.get' % rest_pkg, return_value=FR()) |
|
231 |
def test_floating_ip_pools_get(self, get): |
|
232 |
for args in product( |
|
233 |
('tenant1', 'tenant2'), |
|
234 |
(200, 204), |
|
235 |
({}, {'k': 'v'})): |
|
236 |
tenant_id, success, kwargs = args |
|
237 |
r = self.client.floating_ip_pools_get(tenant_id, success, **kwargs) |
|
238 |
self.assertTrue(isinstance(r, FR)) |
|
239 |
self.assertEqual(get.mock_calls[-1], call( |
|
240 |
'/%s/os-floating-ip-pools' % tenant_id, |
|
241 |
success=success, **kwargs)) |
|
242 |
|
|
230 | 243 |
|
231 | 244 |
class ComputeClient(TestCase): |
232 | 245 |
|
b/kamaki/clients/cyclades/rest_api.py | ||
---|---|---|
165 | 165 |
|
166 | 166 |
path = path4url('networks', network_id, command) |
167 | 167 |
return self.put(path, data=data, success=success, **kwargs) |
168 |
|
|
169 |
def floating_ip_pools_get(self, success=200, **kwargs): |
|
170 |
path = path4url('os-floating-ip-pools') |
|
171 |
return self.get(path, success=success, **kwargs) |
b/kamaki/clients/cyclades/test.py | ||
---|---|---|
204 | 204 |
data=json_data, success=success, |
205 | 205 |
**kwargs)) |
206 | 206 |
|
207 |
@patch('%s.get' % rest_pkg, return_value=FR()) |
|
208 |
def test_floating_ip_pools_get(self, get): |
|
209 |
for args in product( |
|
210 |
(200, 204), |
|
211 |
({}, {'k': 'v'})): |
|
212 |
success, kwargs = args |
|
213 |
r = self.client.floating_ip_pools_get(success, **kwargs) |
|
214 |
self.assertTrue(isinstance(r, FR)) |
|
215 |
self.assertEqual(get.mock_calls[-1], call( |
|
216 |
'/os-floating-ip-pools', success=success, **kwargs)) |
|
217 |
|
|
207 | 218 |
|
208 | 219 |
class CycladesClient(TestCase): |
209 | 220 |
|
Also available in: Unified diff