MCPcopy Create free account
hub / github.com/pallets/quart / test_method_view

Function test_method_view

tests/test_views.py:39–53  ·  view source on GitHub ↗
(app: Quart)

Source from the content-addressed store, hash-verified

37
38
39async def test_method_view(app: Quart) -> None:
40 class Views(MethodView):
41 async def get(self) -> ResponseReturnValue:
42 return "GET"
43
44 async def post(self) -> ResponseReturnValue:
45 return "POST"
46
47 app.add_url_rule("/", view_func=Views.as_view("simple"))
48
49 test_client = app.test_client()
50 response = await test_client.get("/")
51 assert "GET" == (await response.get_data(as_text=True))
52 response = await test_client.post("/")
53 assert "POST" == (await response.get_data(as_text=True))
54
55
56async def test_view_decorators(app: Quart) -> None:

Callers

nothing calls this directly

Calls 5

as_viewMethod · 0.80
test_clientMethod · 0.45
getMethod · 0.45
get_dataMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…