()
| 70 | |
| 71 | |
| 72 | def test_provide_automatic_options_attr(): |
| 73 | app = flask.Flask(__name__) |
| 74 | |
| 75 | def index(): |
| 76 | return "Hello World!" |
| 77 | |
| 78 | index.provide_automatic_options = False |
| 79 | app.route("/")(index) |
| 80 | rv = app.test_client().open("/", method="OPTIONS") |
| 81 | assert rv.status_code == 405 |
| 82 | |
| 83 | app = flask.Flask(__name__) |
| 84 | |
| 85 | def index2(): |
| 86 | return "Hello World!" |
| 87 | |
| 88 | index2.provide_automatic_options = True |
| 89 | app.route("/", methods=["OPTIONS"])(index2) |
| 90 | rv = app.test_client().open("/", method="OPTIONS") |
| 91 | assert sorted(rv.allow) == ["OPTIONS"] |
| 92 | |
| 93 | |
| 94 | def test_provide_automatic_options_kwarg(app, client): |
nothing calls this directly
no test coverage detected