(aiohttp_client: AiohttpClient)
| 792 | |
| 793 | |
| 794 | async def test_decorate_view(aiohttp_client: AiohttpClient) -> None: |
| 795 | routes = web.RouteTableDef() |
| 796 | |
| 797 | @routes.view("/a") |
| 798 | class MyView(web.View): |
| 799 | async def get(self) -> web.Response: |
| 800 | return web.Response() |
| 801 | |
| 802 | async def post(self) -> web.Response: |
| 803 | return web.Response() |
| 804 | |
| 805 | app = web.Application() |
| 806 | app.router.add_routes(routes) |
| 807 | |
| 808 | client = await aiohttp_client(app) |
| 809 | |
| 810 | r = await client.get("/a") |
| 811 | assert r.status == 200 |
| 812 | await r.release() |
| 813 | |
| 814 | r = await client.post("/a") |
| 815 | assert r.status == 200 |
| 816 | await r.release() |
| 817 | |
| 818 | r = await client.put("/a") |
| 819 | assert r.status == 405 |
| 820 | await r.release() |
| 821 | |
| 822 | |
| 823 | async def test_web_view(aiohttp_client: AiohttpClient) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…