Home / Function/ test_provide_automatic_options_attr() — flask Function Reference

test_provide_automatic_options_attr() — flask Function Reference

Architecture documentation for the test_provide_automatic_options_attr() function in test_basic.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  49138732_feb3_627c_4130_7bf95aaefeee["test_provide_automatic_options_attr()"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f["test_basic.py"]
  49138732_feb3_627c_4130_7bf95aaefeee -->|defined in| 85bc4fb5_d1d7_a135_020d_69e052c12c0f
  6ea1611d_2801_3cb5_a5b9_5b6403cc0537["index()"]
  49138732_feb3_627c_4130_7bf95aaefeee -->|calls| 6ea1611d_2801_3cb5_a5b9_5b6403cc0537
  style 49138732_feb3_627c_4130_7bf95aaefeee fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_basic.py lines 70–89

def test_provide_automatic_options_attr():
    app = flask.Flask(__name__)

    def index():
        return "Hello World!"

    index.provide_automatic_options = False
    app.route("/")(index)
    rv = app.test_client().open("/", method="OPTIONS")
    assert rv.status_code == 405

    app = flask.Flask(__name__)

    def index2():
        return "Hello World!"

    index2.provide_automatic_options = True
    app.route("/", methods=["OPTIONS"])(index2)
    rv = app.test_client().open("/", method="OPTIONS")
    assert sorted(rv.allow) == ["OPTIONS"]

Subdomains

Defined In

Calls

Frequently Asked Questions

What does test_provide_automatic_options_attr() do?
test_provide_automatic_options_attr() is a function in the flask codebase, defined in tests/test_basic.py.
Where is test_provide_automatic_options_attr() defined?
test_provide_automatic_options_attr() is defined in tests/test_basic.py at line 70.
What does test_provide_automatic_options_attr() call?
test_provide_automatic_options_attr() 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