From 2dc3d81031ad6ebafcd00a095e18a80dfe271674 Mon Sep 17 00:00:00 2001 From: ZhiQiang Fan Date: Mon, 2 Sep 2013 02:21:55 +0800 Subject: [PATCH] Add auth_uri in conf to avoid unnecessary warning Unittest code for auth_token.py doesn't specify auth_uri in conf, which will cause lots of warnings, since auth_token.py will use '%(protocol)s://%(host)s:%(port)s' to generate auth_uri when it is None, we can specify this value directly to avoid unnecessary warnings. Closes-Bug: #1219493 Change-Id: I26b636bcddabd91b06479c6a42a6a48d74ac9431 --- keystoneclient/tests/test_auth_token_middleware.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/keystoneclient/tests/test_auth_token_middleware.py b/keystoneclient/tests/test_auth_token_middleware.py index 06e760989..4f4c594a0 100644 --- a/keystoneclient/tests/test_auth_token_middleware.py +++ b/keystoneclient/tests/test_auth_token_middleware.py @@ -212,7 +212,8 @@ class BaseAuthTokenMiddlewareTest(testtools.TestCase): 'auth_protocol': 'https', 'auth_admin_prefix': '/testadmin', 'signing_dir': client_fixtures.CERTDIR, - 'auth_version': auth_version + 'auth_version': auth_version, + 'auth_uri': 'https://keystone.example.com:1234', } self.response_status = None @@ -374,6 +375,7 @@ class NoMemcacheAuthToken(BaseAuthTokenMiddlewareTest): 'auth_host': 'keystone.example.com', 'auth_port': 1234, 'memcached_servers': 'localhost:11211', + 'auth_uri': 'https://keystone.example.com:1234', } auth_token.AuthProtocol(FakeApp(), conf) @@ -402,6 +404,7 @@ class CommonAuthTokenMiddlewareTest(object): 'auth_host': '2001:2013:1:f101::1', 'auth_port': 1234, 'auth_protocol': 'http', + 'auth_uri': None, } self.set_middleware(conf=conf) expected_auth_uri = 'http://[2001:2013:1:f101::1]:1234' @@ -776,7 +779,8 @@ class CommonAuthTokenMiddlewareTest(object): def test_config_revocation_cache_timeout(self): conf = { - 'revocation_cache_time': 24 + 'revocation_cache_time': 24, + 'auth_uri': 'https://keystone.example.com:1234', } middleware = auth_token.AuthProtocol(self.fake_app, conf) self.assertEquals(middleware.token_revocation_list_cache_timeout,