Merge pull request #202 from roycaihw/fix/add-old-token

Add old api_key to set auth attributes
This commit is contained in:
Kubernetes Prow Robot 2020-07-16 01:03:41 -07:00 committed by GitHub
commit 7fc2c315c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1399,11 +1399,13 @@ class TestKubernetesClientConfiguration(BaseTestCase):
def test_auth_settings_calls_get_api_key_with_prefix(self):
expected_token = 'expected_token'
old_token = 'old_token'
def fake_get_api_key_with_prefix(identifier):
self.assertEqual('authorization', identifier)
return expected_token
config = Configuration()
config.api_key['authorization'] = old_token
config.get_api_key_with_prefix = fake_get_api_key_with_prefix
self.assertEqual(expected_token,
config.auth_settings()['BearerToken']['value'])