From 105b6176e9da663ff00d3c2ea633d8d0e5b9a44f Mon Sep 17 00:00:00 2001 From: apantykhin Date: Mon, 18 Jun 2018 09:41:25 +0000 Subject: [PATCH] fix --- tests/test_memcached_storage.py | 4 ++-- tests/test_nacl_storage.py | 8 ++++---- tests/test_redis_storage.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_memcached_storage.py b/tests/test_memcached_storage.py index ecdb33ed..5e8ff7aa 100644 --- a/tests/test_memcached_storage.py +++ b/tests/test_memcached_storage.py @@ -231,7 +231,7 @@ async def logout(request): async def test_load_session_dont_load_expired_session(aiohttp_client, - dynamodb_client): + memcached): async def handler(request): session = await get_session(request) exp_param = request.rel_url.query.get('exp', None) @@ -244,7 +244,7 @@ async def handler(request): return web.Response(body=b'OK') client = await aiohttp_client( - create_app(handler, dynamodb_client, 2) + create_app(handler, memcached, 2) ) resp = await client.get('/') assert resp.status == 200 diff --git a/tests/test_nacl_storage.py b/tests/test_nacl_storage.py index 4af75d10..66bd8145 100644 --- a/tests/test_nacl_storage.py +++ b/tests/test_nacl_storage.py @@ -31,8 +31,8 @@ def make_cookie(client, secretbox, data): client.session.cookie_jar.update_cookies({'AIOHTTP_SESSION': data}) -def create_app(handler, key): - middleware = session_middleware(NaClCookieStorage(key)) +def create_app(handler, key, max_age=None): + middleware = session_middleware(NaClCookieStorage(key, max_age=max_age)) app = web.Application(middlewares=[middleware]) app.router.add_route('GET', '/', handler) return app @@ -157,7 +157,7 @@ async def logout(request): async def test_load_session_dont_load_expired_session(aiohttp_client, - dynamodb_client): + key): async def handler(request): session = await get_session(request) exp_param = request.rel_url.query.get('exp', None) @@ -170,7 +170,7 @@ async def handler(request): return web.Response(body=b'OK') client = await aiohttp_client( - create_app(handler, dynamodb_client, 2) + create_app(handler, key, 2) ) resp = await client.get('/') assert resp.status == 200 diff --git a/tests/test_redis_storage.py b/tests/test_redis_storage.py index 083ed53c..76b927f9 100644 --- a/tests/test_redis_storage.py +++ b/tests/test_redis_storage.py @@ -314,7 +314,7 @@ def __init__(self, *args, **kwargs): async def test_load_session_dont_load_expired_session(aiohttp_client, - dynamodb_client): + redis): async def handler(request): session = await get_session(request) exp_param = request.rel_url.query.get('exp', None) @@ -327,7 +327,7 @@ async def handler(request): return web.Response(body=b'OK') client = await aiohttp_client( - create_app(handler, dynamodb_client, 2) + create_app(handler, redis, 2) ) resp = await client.get('/') assert resp.status == 200