diff options
author | spisarski <s.pisarski@cablelabs.com> | 2017-06-01 12:16:50 -0600 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2017-06-01 12:16:50 -0600 |
commit | bb14b25047aabe1712aa34c0e2796e312b0b1af4 (patch) | |
tree | 78121434dd9213e7ef59c8b2dc17a9c31bb5ca9c /snaps/openstack/utils/tests/keystone_utils_tests.py | |
parent | 5718894fcfb3e44dd08435cf71d2f1094425bed5 (diff) |
Refactor keystone endpoint tests to the proper test class.
Also added documentation for those three tests.
Change-Id: I38a728ba9e258a821341621978953e0529a0c1a1
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/tests/keystone_utils_tests.py')
-rw-r--r-- | snaps/openstack/utils/tests/keystone_utils_tests.py | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/snaps/openstack/utils/tests/keystone_utils_tests.py b/snaps/openstack/utils/tests/keystone_utils_tests.py index 7bd7f5a..845b20b 100644 --- a/snaps/openstack/utils/tests/keystone_utils_tests.py +++ b/snaps/openstack/utils/tests/keystone_utils_tests.py @@ -46,32 +46,6 @@ class KeystoneSmokeTests(OSComponentTestCase): keystone = keystone_utils.keystone_client(OSCreds('user', 'pass', 'url', 'project')) keystone.users.list() - def test_get_endpoint_success(self): - """ - Tests to ensure that proper credentials and proper service type can succeed. - """ - endpoint = keystone_utils.get_endpoint(self.os_creds, - service_type="identity") - self.assertIsNotNone(endpoint) - - def test_get_endpoint_fail_without_proper_service(self): - """ - Tests to ensure that proper credentials and improper service type cannot succeed. - """ - with self.assertRaises(Exception): - keystone_utils.get_endpoint(self.os_creds, service_type="glance") - - def test_get_endpoint_fail_without_proper_credentials(self): - """ - Tests to ensure that improper credentials and proper service type cannot succeed. - """ - from snaps.openstack.os_credentials import OSCreds - - with self.assertRaises(Exception): - keystone_utils.get_endpoint( - OSCreds('user', 'pass', 'url', 'project'), - service_type="image") - class KeystoneUtilsTests(OSComponentTestCase): """ @@ -124,3 +98,29 @@ class KeystoneUtilsTests(OSComponentTestCase): project = keystone_utils.get_project(keystone=self.keystone, project_name=project_settings.name) self.assertIsNotNone(project) self.assertEqual(self.project_name, self.project.name) + + def test_get_endpoint_success(self): + """ + Tests to ensure that proper credentials and proper service type can succeed. + """ + endpoint = keystone_utils.get_endpoint(self.os_creds, + service_type="identity") + self.assertIsNotNone(endpoint) + + def test_get_endpoint_fail_without_proper_service(self): + """ + Tests to ensure that proper credentials and improper service type cannot succeed. + """ + with self.assertRaises(Exception): + keystone_utils.get_endpoint(self.os_creds, service_type="glance") + + def test_get_endpoint_fail_without_proper_credentials(self): + """ + Tests to ensure that improper credentials and proper service type cannot succeed. + """ + from snaps.openstack.os_credentials import OSCreds + + with self.assertRaises(Exception): + keystone_utils.get_endpoint( + OSCreds('user', 'pass', 'url', 'project'), + service_type="image") |