Skip to content

Commit 234f68c

Browse files
committed
Added test.
Signed-off-by: Pavel Kirilin <win10@list.ru>
1 parent 1183781 commit 234f68c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/test_func_dependencies.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,18 @@ async def handler(num: int = Depends(original_dep)) -> web.Response:
7979
resp = await client.get("/")
8080
assert resp.status == 200
8181
assert (await resp.json())["request"] == 2
82+
83+
84+
@pytest.mark.anyio
85+
async def test_ordinary_functions_support(
86+
my_app: web.Application,
87+
aiohttp_client: ClientGenerator,
88+
) -> None:
89+
async def handler(request: web.Request) -> web.Response:
90+
return web.json_response({"request": "ordinary"})
91+
92+
my_app.router.add_get("/", handler)
93+
client = await aiohttp_client(my_app)
94+
resp = await client.get("/")
95+
assert resp.status == 200
96+
assert await resp.json() == {"request": "ordinary"}

0 commit comments

Comments
 (0)