MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / test_render_unknown_method

Function test_render_unknown_method

tests/test_classbasedview.py:28–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26
27
28async 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
43async def test_render_unsupported_method() -> None:

Callers

nothing calls this directly

Calls 1

MyViewClass · 0.70

Tested by

no test coverage detected