Merge "Identity V3: missing api coverage for 'Get Endpoint' method"
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index 2ac832e..2538829 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -71,7 +71,7 @@
', '.join(str(e) for e in missing_endpoints))
@test.idempotent_id('0e2446d2-c1fd-461b-a729-b9e73e3e3b37')
- def test_create_list_delete_endpoint(self):
+ def test_create_list_show_delete_endpoint(self):
region = data_utils.rand_name('region')
url = data_utils.rand_url()
interface = 'public'
@@ -79,16 +79,30 @@
interface=interface,
url=url, region=region,
enabled=True)['endpoint']
+
# Asserting Create Endpoint response body
self.assertIn('id', endpoint)
self.assertEqual(region, endpoint['region'])
self.assertEqual(url, endpoint['url'])
+
# Checking if created endpoint is present in the list of endpoints
fetched_endpoints = self.client.list_endpoints()['endpoints']
fetched_endpoints_id = [e['id'] for e in fetched_endpoints]
self.assertIn(endpoint['id'], fetched_endpoints_id)
+
+ # Show endpoint
+ fetched_endpoint = (
+ self.client.show_endpoint(endpoint['id'])['endpoint'])
+ # Asserting if the attributes of endpoint are the same
+ self.assertEqual(self.service_id, fetched_endpoint['service_id'])
+ self.assertEqual(interface, fetched_endpoint['interface'])
+ self.assertEqual(url, fetched_endpoint['url'])
+ self.assertEqual(region, fetched_endpoint['region'])
+ self.assertEqual(True, fetched_endpoint['enabled'])
+
# Deleting the endpoint created in this method
self.client.delete_endpoint(endpoint['id'])
+
# Checking whether endpoint is deleted successfully
fetched_endpoints = self.client.list_endpoints()['endpoints']
fetched_endpoints_id = [e['id'] for e in fetched_endpoints]
diff --git a/tempest/services/identity/v3/json/endpoints_client.py b/tempest/services/identity/v3/json/endpoints_client.py
index ede5edb..8ab7464 100644
--- a/tempest/services/identity/v3/json/endpoints_client.py
+++ b/tempest/services/identity/v3/json/endpoints_client.py
@@ -61,3 +61,10 @@
resp_header, resp_body = self.delete('endpoints/%s' % endpoint_id)
self.expected_success(204, resp_header.status)
return service_client.ResponseBody(resp_header, resp_body)
+
+ def show_endpoint(self, endpoint_id):
+ """Get endpoint."""
+ resp_header, resp_body = self.get('endpoints/%s' % endpoint_id)
+ self.expected_success(200, resp_header.status)
+ resp_body = json.loads(resp_body)
+ return service_client.ResponseBody(resp_header, resp_body)