Commit 0a62912d authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Implement floating_ip_pools_get @compute/cyclades

Refs: #3862
parent 7983398f
......@@ -237,3 +237,7 @@ class ComputeRestClient(Client):
path = path4url('images', image_id, command)
return self.put(path, data=data, success=success, **kwargs)
def floating_ip_pools_get(self, tenant_id, success=200, **kwargs):
path = path4url(tenant_id, 'os-floating-ip-pools')
return self.get(path, success=success, **kwargs)
......@@ -227,6 +227,19 @@ class ComputeRestClient(TestCase):
def test_images_put(self):
self._test_put('images')
@patch('%s.get' % rest_pkg, return_value=FR())
def test_floating_ip_pools_get(self, get):
for args in product(
('tenant1', 'tenant2'),
(200, 204),
({}, {'k': 'v'})):
tenant_id, success, kwargs = args
r = self.client.floating_ip_pools_get(tenant_id, success, **kwargs)
self.assertTrue(isinstance(r, FR))
self.assertEqual(get.mock_calls[-1], call(
'/%s/os-floating-ip-pools' % tenant_id,
success=success, **kwargs))
class ComputeClient(TestCase):
......
......@@ -165,3 +165,7 @@ class CycladesRestClient(ComputeClient):
path = path4url('networks', network_id, command)
return self.put(path, data=data, success=success, **kwargs)
def floating_ip_pools_get(self, success=200, **kwargs):
path = path4url('os-floating-ip-pools')
return self.get(path, success=success, **kwargs)
......@@ -204,6 +204,17 @@ class CycladesRestClient(TestCase):
data=json_data, success=success,
**kwargs))
@patch('%s.get' % rest_pkg, return_value=FR())
def test_floating_ip_pools_get(self, get):
for args in product(
(200, 204),
({}, {'k': 'v'})):
success, kwargs = args
r = self.client.floating_ip_pools_get(success, **kwargs)
self.assertTrue(isinstance(r, FR))
self.assertEqual(get.mock_calls[-1], call(
'/os-floating-ip-pools', success=success, **kwargs))
class CycladesClient(TestCase):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment