MCPcopy Create free account
hub / github.com/pallets/flask / test_options_on_multiple_rules

Function test_options_on_multiple_rules

tests/test_basic.py:40–50  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

38
39
40def test_options_on_multiple_rules(app, client):
41 @app.route("/", methods=["GET", "POST"])
42 def index():
43 return "Hello World"
44
45 @app.route("/", methods=["PUT"])
46 def index_put():
47 return "Aha!"
48
49 rv = client.open("/", method="OPTIONS")
50 assert sorted(rv.allow) == ["GET", "HEAD", "OPTIONS", "POST", "PUT"]
51
52
53@pytest.mark.parametrize("method", ["get", "post", "put", "delete", "patch"])

Callers

nothing calls this directly

Calls 1

openMethod · 0.80

Tested by

no test coverage detected