test_provide_automatic_options_kwarg() — flask Function Reference
Architecture documentation for the test_provide_automatic_options_kwarg() function in test_basic.py from the flask codebase.
Entity Profile
Dependency Diagram
graph TD cc1db332_f686_5619_55c9_3bf70bd59625["test_provide_automatic_options_kwarg()"] 85bc4fb5_d1d7_a135_020d_69e052c12c0f["test_basic.py"] cc1db332_f686_5619_55c9_3bf70bd59625 -->|defined in| 85bc4fb5_d1d7_a135_020d_69e052c12c0f 6ea1611d_2801_3cb5_a5b9_5b6403cc0537["index()"] cc1db332_f686_5619_55c9_3bf70bd59625 -->|calls| 6ea1611d_2801_3cb5_a5b9_5b6403cc0537 style cc1db332_f686_5619_55c9_3bf70bd59625 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_basic.py lines 92–126
def test_provide_automatic_options_kwarg(app, client):
def index():
return flask.request.method
def more():
return flask.request.method
app.add_url_rule("/", view_func=index, provide_automatic_options=False)
app.add_url_rule(
"/more",
view_func=more,
methods=["GET", "POST"],
provide_automatic_options=False,
)
assert client.get("/").data == b"GET"
rv = client.post("/")
assert rv.status_code == 405
assert sorted(rv.allow) == ["GET", "HEAD"]
rv = client.open("/", method="OPTIONS")
assert rv.status_code == 405
rv = client.head("/")
assert rv.status_code == 200
assert not rv.data # head truncates
assert client.post("/more").data == b"POST"
assert client.get("/more").data == b"GET"
rv = client.delete("/more")
assert rv.status_code == 405
assert sorted(rv.allow) == ["GET", "HEAD", "POST"]
rv = client.open("/more", method="OPTIONS")
assert rv.status_code == 405
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does test_provide_automatic_options_kwarg() do?
test_provide_automatic_options_kwarg() is a function in the flask codebase, defined in tests/test_basic.py.
Where is test_provide_automatic_options_kwarg() defined?
test_provide_automatic_options_kwarg() is defined in tests/test_basic.py at line 92.
What does test_provide_automatic_options_kwarg() call?
test_provide_automatic_options_kwarg() calls 1 function(s): index.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free