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