Fix the unittest of get_endpoint 71/37171/2
authorLinda Wang <wangwulin@huawei.com>
Tue, 11 Jul 2017 10:16:59 +0000 (10:16 +0000)
committerLinda Wang <wangwulin@huawei.com>
Wed, 12 Jul 2017 14:57:12 +0000 (14:57 +0000)
The endpoints according to interface may be same or different
on different deployment, which depends on the configuration
during the deployment.

Change-Id: Id2127a3c3fe0eca4b10a98c548d10391912f9610
Signed-off-by: Linda Wang <wangwulin@huawei.com>
snaps/openstack/utils/tests/keystone_utils_tests.py

index 89b2b2c..336b9ea 100644 (file)
@@ -138,9 +138,9 @@ class KeystoneUtilsTests(OSComponentTestCase):
                         project_name='project'),
                 service_type='image')
 
-    def test_get_endpoint_with_different_interface(self):
+    def test_get_endpoint_with_each_interface(self):
         """
-        Tests to ensure that different endpoint urls are obtained with
+        Tests to ensure that endpoint urls are obtained with
         'public', 'internal' and 'admin' interface
         """
         endpoint_public = keystone_utils.get_endpoint(self.os_creds,
@@ -152,9 +152,9 @@ class KeystoneUtilsTests(OSComponentTestCase):
         endpoint_admin = keystone_utils.get_endpoint(self.os_creds,
                                                      service_type='image',
                                                      interface='admin')
-        self.assertNotEqual(endpoint_public, endpoint_internal)
-        self.assertNotEqual(endpoint_public, endpoint_admin)
-        self.assertEqual(endpoint_admin, endpoint_internal)
+        self.assertIsNotNone(endpoint_public)
+        self.assertIsNotNone(endpoint_internal)
+        self.assertIsNotNone(endpoint_admin)
 
     def test_grant_user_role_to_project(self):
         """