MCPcopy
hub / github.com/pallets/flask / common_test

Function common_test

tests/test_views.py:7–14  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

5
6
7def common_test(app):
8 c = app.test_client()
9
10 assert c.get("/").data == b"GET"
11 assert c.post("/").data == b"POST"
12 assert c.put("/").status_code == 405
13 meths = parse_set_header(c.open("/", method="OPTIONS").headers["Allow"])
14 assert sorted(meths) == ["GET", "HEAD", "OPTIONS", "POST"]
15
16
17def test_basic_view(app):

Callers 4

test_basic_viewFunction · 0.85
test_method_based_viewFunction · 0.85
test_view_patchingFunction · 0.85
test_endpoint_overrideFunction · 0.85

Calls 5

test_clientMethod · 0.80
putMethod · 0.80
openMethod · 0.80
getMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected