Skip to content

Commit

Permalink
Added test.
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Kirilin <[email protected]>
  • Loading branch information
s3rius committed Feb 5, 2024
1 parent 1183781 commit 234f68c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_func_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,18 @@ async def handler(num: int = Depends(original_dep)) -> web.Response:
resp = await client.get("/")
assert resp.status == 200
assert (await resp.json())["request"] == 2


@pytest.mark.anyio
async def test_ordinary_functions_support(
my_app: web.Application,
aiohttp_client: ClientGenerator,
) -> None:
async def handler(request: web.Request) -> web.Response:
return web.json_response({"request": "ordinary"})

my_app.router.add_get("/", handler)
client = await aiohttp_client(my_app)
resp = await client.get("/")
assert resp.status == 200
assert await resp.json() == {"request": "ordinary"}

0 comments on commit 234f68c

Please sign in to comment.