()
| 26 | |
| 27 | |
| 28 | async def test_render_unknown_method() -> None: |
| 29 | class MyView(View): |
| 30 | async def get(self): |
| 31 | return web.Response(text="OK") |
| 32 | |
| 33 | options = get |
| 34 | |
| 35 | request = mock.Mock() |
| 36 | request.method = "UNKNOWN" |
| 37 | with pytest.raises(web.HTTPMethodNotAllowed) as ctx: |
| 38 | await MyView(request) |
| 39 | assert ctx.value.headers["allow"] == "GET,OPTIONS" |
| 40 | assert ctx.value.status == 405 |
| 41 | |
| 42 | |
| 43 | async def test_render_unsupported_method() -> None: |