Skip to content

Commit

Permalink
Compare token expiry without seconds
Browse files Browse the repository at this point in the history
There is a rounding problem that occurs periodically.  Token expiration
Does not need to be confirmed to this level of granularity.

Bug 1045962

Change-Id: I361c5cf309c47b142c35c4359234fd0e44005e5a
  • Loading branch information
Adam Young committed Oct 24, 2012
1 parent f33e9f0 commit e94d2f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_keystoneclient.py
Expand Up @@ -392,9 +392,11 @@ def test_token_expiry_maintained(self):
time.sleep(1.01)
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(orig_token['expires'],
reauthenticated_token.expires)
self.assertEquals(original, reissued)

def test_user_create_update_delete(self):
from keystoneclient import exceptions as client_exceptions
Expand Down

0 comments on commit e94d2f9

Please sign in to comment.