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

Function test_render_unsupported_method

tests/test_classbasedview.py:43–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41
42
43async def test_render_unsupported_method() -> None:
44 class MyView(View):
45 async def get(self):
46 return web.Response(text="OK")
47
48 options = delete = get
49
50 request = mock.Mock()
51 request.method = "POST"
52 with pytest.raises(web.HTTPMethodNotAllowed) as ctx:
53 await MyView(request)
54 assert ctx.value.headers["allow"] == "DELETE,GET,OPTIONS"
55 assert ctx.value.status == 405

Callers

nothing calls this directly

Calls 1

MyViewClass · 0.70

Tested by

no test coverage detected