Skip to content

Commit

Permalink
add missing types for generic
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Nov 27, 2024
1 parent 9415db5 commit ff409c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/test_redis_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create_app(


async def make_cookie(
client: TestClient, redis: aioredis.Redis, data: dict[Any, Any]
client: TestClient[web.Request, web.Application], redis: aioredis.Redis, data: dict[Any, Any]
) -> None:
session_data = {"session": data, "created": int(time.time())}
value = json.dumps(session_data)
Expand All @@ -43,13 +43,13 @@ async def make_cookie(
client.session.cookie_jar.update_cookies({"AIOHTTP_SESSION": key})


async def make_cookie_with_bad_value(client: TestClient, redis: aioredis.Redis) -> None:
async def make_cookie_with_bad_value(client: TestClient[web.Request, web.Application], redis: aioredis.Redis) -> None:
key = uuid.uuid4().hex
await redis.set("AIOHTTP_SESSION_" + key, "")
client.session.cookie_jar.update_cookies({"AIOHTTP_SESSION": key})


async def load_cookie(client: TestClient, redis: aioredis.Redis) -> Any:
async def load_cookie(client: TestClient[web.Request, web.Application], redis: aioredis.Redis) -> Any:
cookies = client.session.cookie_jar.filter_cookies(client.make_url("/"))
key = cookies["AIOHTTP_SESSION"]
value_bytes = await redis.get("AIOHTTP_SESSION_" + key.value)
Expand Down
2 changes: 1 addition & 1 deletion tests/typedefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from aiohttp import web
from aiohttp.test_utils import TestClient

AiohttpClient = Callable[[web.Application], Awaitable[TestClient]]
AiohttpClient = Callable[[web.Application], Awaitable[TestClient[web.Request, web.Application]]]

0 comments on commit ff409c1

Please sign in to comment.