(app, client)
| 38 | |
| 39 | |
| 40 | def 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"]) |