Revision 6f2b9836 snf-tools/synnefo_tools/burnin/astakos_tests.py
b/snf-tools/synnefo_tools/burnin/astakos_tests.py | ||
---|---|---|
43 | 43 |
|
44 | 44 |
|
45 | 45 |
# Too many public methods (47/20). pylint: disable-msg=R0904 |
46 |
class AstakosTestCase(common.BurninTests):
|
|
46 |
class AstakosTestSuite(common.BurninTests):
|
|
47 | 47 |
"""Test Astakos functionality""" |
48 | 48 |
def test_unauthorized_access(self): |
49 |
"""Test access without a valid token fails""" |
|
49 |
"""Test that access without a valid token fails"""
|
|
50 | 50 |
false_token = "12345" |
51 |
self.info("Will use token %s", false_token) |
|
51 | 52 |
client = ComputeClient(self.clients.compute_url, false_token) |
52 | 53 |
client.CONNECTION_RETRY_LIMIT = self.clients.retry |
53 | 54 |
|
... | ... | |
55 | 56 |
client.list_servers() |
56 | 57 |
self.assertEqual(cl_error.exception.status, 401) |
57 | 58 |
|
59 |
def test_name2uuid(self): |
|
60 |
"""Test that usernames2uuids and uuids2usernames are complementary""" |
|
61 |
our_uuid = self._get_uuid() |
|
58 | 62 |
|
59 |
class AstakosFoo(common.BurninTests): |
|
60 |
"""Just Fail""" |
|
61 |
def test_just_foo(self): |
|
62 |
"""A test that just fails""" |
|
63 |
self.fail("just fail") |
|
63 |
given_name = self.clients.astakos.uuids2usernames([our_uuid]) |
|
64 |
self.info("uuids2usernames returned %s", given_name) |
|
65 |
self.assertIn(our_uuid, given_name) |
|
66 |
|
|
67 |
given_uuid = \ |
|
68 |
self.clients.astakos.usernames2uuids([given_name[our_uuid]]) |
|
69 |
self.info("usernames2uuids returned %s", given_uuid) |
|
70 |
self.assertIn(given_name[our_uuid], given_uuid) |
|
71 |
|
|
72 |
self.assertEqual(given_uuid[given_name[our_uuid]], our_uuid) |
Also available in: Unified diff