Skip to content

Commit

Permalink
Refix transient test failures
Browse files Browse the repository at this point in the history
Commit a10bd7a fixed the issue with
transient test failures, but during the rebase of the commit
be754ff the fix was lost.

Fixes bug 1077065

Change-Id: I14311f56e6dd0103620b58e64bf0c78c7e32f61c
  • Loading branch information
alvarolopez committed Nov 16, 2012
1 parent 36a247c commit 07525b1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ def assertEqualTokens(self, a, b):
"""
def normalize(token):
token['access']['token']['id'] = 'dummy'
# truncate to eliminate timing problems
issued = token['access']['token']['issued_at']
token['access']['token']['issued_at'] = issued[:-8]
# truncate to eliminate timing problems
expires = token['access']['token']['expires']
token['access']['token']['expires'] = expires[:-3]
del token['access']['token']['expires']
del token['access']['token']['issued_at']
return token

self.assertCloseEnoughForGovernmentWork(
timeutils.parse_isotime(a['access']['token']['expires']),
timeutils.parse_isotime(b['access']['token']['expires']))
self.assertCloseEnoughForGovernmentWork(
timeutils.parse_isotime(a['access']['token']['issued_at']),
timeutils.parse_isotime(b['access']['token']['issued_at']))
return self.assertDictEqual(normalize(a), normalize(b))


Expand Down

0 comments on commit 07525b1

Please sign in to comment.