Merge "Fix the AttributeError: __exit__ error"
This commit is contained in:
commit
a742c2a77a
@ -98,8 +98,7 @@ class _MemcacheClientPool(object):
|
||||
|
||||
@contextlib.contextmanager
|
||||
def reserve(self):
|
||||
with self._pool.get() as client:
|
||||
yield client
|
||||
yield self._pool.get()
|
||||
|
||||
|
||||
class TokenCache(object):
|
||||
|
@ -151,11 +151,17 @@ class TestLiveMemcache(base.BaseAuthTokenTestCase):
|
||||
token_cache.set(token, data)
|
||||
self.assertEqual(token_cache.get(token), data)
|
||||
|
||||
def test_memcache_pool_init(self):
|
||||
def test_memcache_pool(self):
|
||||
conf = {
|
||||
'memcached_servers': ','.join(MEMCACHED_SERVERS),
|
||||
'memcache_use_advanced_pool': True
|
||||
}
|
||||
|
||||
token = six.b(uuid.uuid4().hex)
|
||||
data = uuid.uuid4().hex
|
||||
|
||||
token_cache = self.create_simple_middleware(conf=conf)._token_cache
|
||||
token_cache.initialize({})
|
||||
|
||||
token_cache.set(token, data)
|
||||
self.assertEqual(token_cache.get(token), data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user