diff --git a/keystone/tests/unit/core.py b/keystone/tests/unit/core.py index 732da590a9..598ed20370 100644 --- a/keystone/tests/unit/core.py +++ b/keystone/tests/unit/core.py @@ -823,6 +823,17 @@ class TestCase(BaseTestCase): self.assertTrue(abs(a - b).seconds <= delta, msg) + def assertTimestampEqual(self, expected, value): + # Compare two timestamps but ignore the microseconds part + # of the expected timestamp. Keystone does not track microseconds and + # is working to eliminate microseconds from it's datetimes used. + expected = timeutils.parse_isotime(expected).replace(microsecond=0) + value = timeutils.parse_isotime(value).replace(microsecond=0) + self.assertEqual( + expected, + value, + "%s != %s" % (expected, value)) + def assertNotEmpty(self, l): self.assertTrue(len(l)) diff --git a/keystone/tests/unit/test_v3_auth.py b/keystone/tests/unit/test_v3_auth.py index a0c251ad7d..88af10d3ea 100644 --- a/keystone/tests/unit/test_v3_auth.py +++ b/keystone/tests/unit/test_v3_auth.py @@ -245,17 +245,6 @@ class TokenAPITests(object): return project - def assertTimestampEqual(self, expected, value): - # Compare two timestamps but ignore the microseconds part - # of the expected timestamp. Keystone does not track microseconds and - # is working to eliminate microseconds from it's datetimes used. - expected = timeutils.parse_isotime(expected).replace(microsecond=0) - value = timeutils.parse_isotime(value).replace(microsecond=0) - self.assertEqual( - expected, - value, - "%s != %s" % (expected, value)) - def test_auth_with_token_as_different_user_fails(self): # get the token for a user. This is self.user which is different from # self.default_domain_user. diff --git a/keystone/tests/unit/test_v3_os_revoke.py b/keystone/tests/unit/test_v3_os_revoke.py index 4a74026d52..502fe1c9e1 100644 --- a/keystone/tests/unit/test_v3_os_revoke.py +++ b/keystone/tests/unit/test_v3_os_revoke.py @@ -38,20 +38,6 @@ class OSRevokeTests(test_v3.RestfulTestCase, test_v3.JsonHomeTestMixin): }, } - # TODO(davechen): This method is copied from `keystone.tests.unit. - # test_v3_auth.TokenAPITests`, move this method into utils.py to avoid - # the duplication? - def assertTimestampEqual(self, expected, value): - # Compare two timestamps but ignore the microseconds part - # of the expected timestamp. Keystone does not track microseconds and - # is working to eliminate microseconds from it's datetimes used. - expected = timeutils.parse_isotime(expected).replace(microsecond=0) - value = timeutils.parse_isotime(value).replace(microsecond=0) - self.assertEqual( - expected, - value, - "%s != %s" % (expected, value)) - def test_get_empty_list(self): resp = self.get('/OS-REVOKE/events') self.assertEqual([], resp.json_body['events'])