Add HEAD as a sugar route
This commit is contained in:
parent
f64fff6476
commit
b743948d3e
2 changed files with 17 additions and 0 deletions
|
|
@ -60,6 +60,16 @@ def test_method_route(app, client, method):
|
|||
assert client_method("/").data == b"Hello"
|
||||
|
||||
|
||||
def test_head_method_route(app, client):
|
||||
@app.head("/")
|
||||
def index():
|
||||
return flask.request.method
|
||||
|
||||
rv = client.head("/")
|
||||
assert rv.status_code == 200
|
||||
assert not rv.data
|
||||
|
||||
|
||||
def test_method_route_no_methods(app):
|
||||
with pytest.raises(TypeError):
|
||||
app.get("/", methods=["GET", "POST"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue