Adds missing list_endpoints tests

Change-Id: I737beb9039c48410930fc24084520fb6d716fd73
This commit is contained in:
David Stanek 2015-04-22 18:31:24 +00:00 committed by Morgan Fainberg
parent bd1937d16c
commit a92e501be7
2 changed files with 30 additions and 0 deletions

View File

@ -5077,6 +5077,29 @@ class CatalogTests(object):
return service_ref, enabled_endpoint_ref, disabled_endpoint_ref
def test_list_endpoints(self):
service = {
'id': uuid.uuid4().hex,
'type': uuid.uuid4().hex,
'name': uuid.uuid4().hex,
'description': uuid.uuid4().hex,
}
self.catalog_api.create_service(service['id'], service.copy())
expected_ids = set([uuid.uuid4().hex for _ in range(3)])
for endpoint_id in expected_ids:
endpoint = {
'id': endpoint_id,
'region_id': None,
'service_id': service['id'],
'interface': 'public',
'url': uuid.uuid4().hex,
}
self.catalog_api.create_endpoint(endpoint['id'], endpoint.copy())
endpoints = self.catalog_api.list_endpoints()
self.assertEqual(expected_ids, set(e['id'] for e in endpoints))
def test_get_catalog_endpoint_disabled(self):
"""Get back only enabled endpoints when get the v2 catalog."""

View File

@ -227,6 +227,13 @@ class TestTemplatedCatalog(tests.TestCase, test_backend.CatalogTests):
def test_update_endpoint(self):
self.skipTest(BROKEN_WRITE_FUNCTIONALITY_MSG)
def test_list_endpoints(self):
# NOTE(dstanek): a future commit will fix this functionality and
# this test
expected_ids = set()
endpoints = self.catalog_api.list_endpoints()
self.assertEqual(expected_ids, set(e['id'] for e in endpoints))
@tests.skip_if_cache_disabled('catalog')
def test_invalidate_cache_when_updating_endpoint(self):
self.skipTest(BROKEN_WRITE_FUNCTIONALITY_MSG)