forked from orbit-oss/flask
automatic options as separate route
This commit is contained in:
parent
dcbede0cb0
commit
80669a0ea8
5 changed files with 56 additions and 30 deletions
|
|
@ -52,6 +52,13 @@ def test_options_on_multiple_rules(app, client):
|
|||
assert sorted(rv.allow) == ["GET", "HEAD", "OPTIONS", "POST", "PUT"]
|
||||
|
||||
|
||||
def test_options_view_args(app: flask.Flask, client: FlaskClient) -> None:
|
||||
"""The automatic options view accepts any view args."""
|
||||
app.add_url_rule("/<a>/<b>", endpoint="add")
|
||||
rv = client.options("/1/2")
|
||||
assert rv.allow == {"GET", "HEAD", "OPTIONS"}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("method", ["get", "post", "put", "delete", "patch"])
|
||||
def test_method_route(app, client, method):
|
||||
method_route = getattr(app, method)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue