summaryrefslogtreecommitdiff
path: root/keystonemiddleware/tests
diff options
context:
space:
mode:
authorwangxiyuan <wangxiyuan@huawei.com>2018-02-08 17:19:28 +0800
committerwangxiyuan <wangxiyuan@huawei.com>2018-02-22 16:27:31 +0800
commitce06c0ce1035964ecf117bd56f769174508dc269 (patch)
tree5b926ea3e21d84dd6f1975d3d2df11bda11da49f /keystonemiddleware/tests
parent2a6a905949cd456667eaec6fb1cf5f09d03a97e2 (diff)
downloadkeystonemiddleware-ce06c0ce1035964ecf117bd56f769174508dc269.tar.gz
Add arguments for MemcacheClientPool init
Now keystonemiddleware use oslo.cache to init the MemcacheClientPool. The MemcacheClientPool in Olso.cache needs (urls, arguments, **kwargs) parameter to init, but keystonemiddleware passed only (urls, **kwargs). Then it leads the error: __init__() takes exactly 3 arguments (2 given) This patch fixed this issue. Please note that even this error is fixed, set "memcache_use_advanced_pool = True" will lead another error, see bug #1747565 for the detail. It will be fixed in the following patch. Closes-bug: #1748160 Change-Id: I642f959ab8b010207314312a6b6a06a6de23e92c
Diffstat (limited to 'keystonemiddleware/tests')
-rw-r--r--keystonemiddleware/tests/unit/auth_token/test_cache.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/keystonemiddleware/tests/unit/auth_token/test_cache.py b/keystonemiddleware/tests/unit/auth_token/test_cache.py
index 6fa1ef2..542f9a1 100644
--- a/keystonemiddleware/tests/unit/auth_token/test_cache.py
+++ b/keystonemiddleware/tests/unit/auth_token/test_cache.py
@@ -150,3 +150,12 @@ class TestLiveMemcache(base.BaseAuthTokenTestCase):
token_cache.initialize({})
token_cache.set(token, data)
self.assertEqual(token_cache.get(token), data)
+
+ def test_memcache_pool_init(self):
+ conf = {
+ 'memcached_servers': ','.join(MEMCACHED_SERVERS),
+ 'memcache_use_advanced_pool': True
+ }
+
+ token_cache = self.create_simple_middleware(conf=conf)._token_cache
+ token_cache.initialize({})