Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpantyukhin committed Jun 18, 2018
1 parent 163ca57 commit 105b617
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/test_memcached_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/test_nacl_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_redis_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 105b617

Please sign in to comment.