diff --git a/keystoneauth1/identity/v3/oidc.py b/keystoneauth1/identity/v3/oidc.py index 0c1df9f6..4d010f44 100644 --- a/keystoneauth1/identity/v3/oidc.py +++ b/keystoneauth1/identity/v3/oidc.py @@ -287,7 +287,7 @@ class OidcPassword(_OidcBase): grant_type = "password" - def __init__(self, auth_url, identity_provider, protocol, + def __init__(self, auth_url, identity_provider, protocol, # nosec client_id, client_secret, access_token_endpoint=None, discovery_endpoint=None, @@ -335,7 +335,7 @@ class OidcClientCredentials(_OidcBase): grant_type = 'client_credentials' - def __init__(self, auth_url, identity_provider, protocol, + def __init__(self, auth_url, identity_provider, protocol, # nosec client_id, client_secret, access_token_endpoint=None, discovery_endpoint=None, @@ -378,7 +378,7 @@ class OidcAuthorizationCode(_OidcBase): grant_type = 'authorization_code' - def __init__(self, auth_url, identity_provider, protocol, + def __init__(self, auth_url, identity_provider, protocol, # nosec client_id, client_secret, access_token_endpoint=None, discovery_endpoint=None, diff --git a/keystoneauth1/tests/unit/identity/test_identity_v2.py b/keystoneauth1/tests/unit/identity/test_identity_v2.py index 530b0468..d7b76b82 100644 --- a/keystoneauth1/tests/unit/identity/test_identity_v2.py +++ b/keystoneauth1/tests/unit/identity/test_identity_v2.py @@ -12,6 +12,7 @@ import copy import json +import time import uuid from keystoneauth1 import _utils as ksa_utils @@ -84,7 +85,8 @@ class V2IdentityPlugin(utils.TestCase): self.TEST_RESPONSE_DICT = { "access": { "token": { - "expires": "2020-01-01T00:00:10.000123Z", + "expires": "%i-02-01T00:00:10.000123Z" % + (1 + time.gmtime().tm_year), "id": self.TEST_TOKEN, "tenant": { "id": self.TEST_TENANT_ID diff --git a/keystoneauth1/tests/unit/identity/test_identity_v3.py b/keystoneauth1/tests/unit/identity/test_identity_v3.py index 1147feef..cfce1af2 100644 --- a/keystoneauth1/tests/unit/identity/test_identity_v3.py +++ b/keystoneauth1/tests/unit/identity/test_identity_v3.py @@ -12,6 +12,7 @@ import copy import json +import time import uuid from keystoneauth1 import _utils as ksa_utils @@ -135,6 +136,7 @@ class V3IdentityPlugin(utils.TestCase): self.TEST_DISCOVERY_RESPONSE = { 'versions': {'values': [fixture.V3Discovery(self.TEST_URL)]}} + nextyear = 1 + time.gmtime().tm_year self.TEST_RESPONSE_DICT = { "token": { "methods": [ @@ -142,7 +144,7 @@ class V3IdentityPlugin(utils.TestCase): "password" ], - "expires_at": "2020-01-01T00:00:10.000123Z", + "expires_at": "%i-02-01T00:00:10.000123Z" % nextyear, "project": { "domain": { "id": self.TEST_DOMAIN_ID, @@ -195,7 +197,7 @@ class V3IdentityPlugin(utils.TestCase): "application_credential" ], - "expires_at": "2020-01-01T00:00:10.000123Z", + "expires_at": "%i-02-01T00:00:10.000123Z" % nextyear, "project": { "domain": { "id": self.TEST_DOMAIN_ID,