Merge "remove the unused method _will_expire_soon"

This commit is contained in:
Jenkins 2014-12-16 21:30:43 +00:00 committed by Gerrit Code Review
commit a1ae56cc3b
2 changed files with 0 additions and 18 deletions

View File

@ -384,16 +384,6 @@ class _BIND_MODE:
KERBEROS = 'kerberos'
def _will_expire_soon(expiry):
"""Determines if expiration is about to occur.
:param expiry: a datetime of the expected expiration
:returns: boolean : true if expiration is within 30 seconds
"""
soon = (timeutils.utcnow() + datetime.timedelta(seconds=30))
return expiry < soon
def _token_is_v2(token_info):
return ('access' in token_info)

View File

@ -470,14 +470,6 @@ class GeneralAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
def test_will_expire_soon(self):
tenseconds = datetime.datetime.utcnow() + datetime.timedelta(
seconds=10)
self.assertTrue(auth_token._will_expire_soon(tenseconds))
fortyseconds = datetime.datetime.utcnow() + datetime.timedelta(
seconds=40)
self.assertFalse(auth_token._will_expire_soon(fortyseconds))
def test_token_is_v2_accepts_v2(self):
token = self.examples.UUID_TOKEN_DEFAULT
token_response = self.examples.TOKEN_RESPONSES[token]