diff options
author | Dolph Mathews <dolph.mathews@gmail.com> | 2012-11-09 10:50:38 -0600 |
---|---|---|
committer | Dolph Mathews <dolph.mathews@gmail.com> | 2012-11-09 10:50:38 -0600 |
commit | a10bd7a8eb418a4d9e84a9511ca3f0669e6e02e7 (patch) | |
tree | 8a0141f81572bbcc1165b79fb950bf5e0bd9fe55 /tests/test_keystoneclient.py | |
parent | 037c06237680d5b5b753fc69eafb432c764b2bd3 (diff) | |
download | keystone-a10bd7a8eb418a4d9e84a9511ca3f0669e6e02e7.tar.gz keystone-a10bd7a8eb418a4d9e84a9511ca3f0669e6e02e7.tar.xz keystone-a10bd7a8eb418a4d9e84a9511ca3f0669e6e02e7.zip |
Fix transient test failures (bug 1077065, bug 1045962)
Change-Id: I45a1167a473df02a4461286b8a09723315018fcb
Diffstat (limited to 'tests/test_keystoneclient.py')
-rw-r--r-- | tests/test_keystoneclient.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_keystoneclient.py b/tests/test_keystoneclient.py index d7294fbb..ce329972 100644 --- a/tests/test_keystoneclient.py +++ b/tests/test_keystoneclient.py @@ -22,6 +22,7 @@ import nose.exc from keystone import test from keystone.openstack.common import jsonutils +from keystone.openstack.common import timeutils import default_fixtures @@ -387,16 +388,15 @@ class KeystoneClientTests(object): def test_token_expiry_maintained(self): foo_client = self.get_client(self.user_foo) - orig_token = foo_client.service_catalog.catalog['token'] - time.sleep(1.01) + orig_token = foo_client.service_catalog.catalog['token'] + time.sleep(.5) reauthenticated_token = foo_client.tokens.authenticate( token=foo_client.auth_token) - #Don't compare seconds, as there is rounding error - original = orig_token['expires'][:-3] - reissued = reauthenticated_token.expires[:-3] - self.assertEquals(original, reissued) + self.assertCloseEnoughForGovernmentWork( + timeutils.parse_isotime(orig_token['expires']), + timeutils.parse_isotime(reauthenticated_token.expires)) def test_user_create_update_delete(self): from keystoneclient import exceptions as client_exceptions |