MCPcopy
hub / github.com/pallets/flask / test_endpoint_decorator

Function test_endpoint_decorator

tests/test_basic.py:216–233  ·  tests/test_basic.py::test_endpoint_decorator
(app, client)

Source from the content-addressed store, hash-verified

214
215
216def test_endpoint_decorator(app, client):
217 from werkzeug.routing import Rule
218 from werkzeug.routing import Submount
219
220 app.url_map.add(
221 Submount(class="st">"/foo", [Rule(class="st">"/bar", endpoint=class="st">"bar"), Rule(class="st">"/", endpoint=class="st">"index")])
222 )
223
224 @app.endpoint(class="st">"bar")
225 def bar():
226 return class="st">"bar"
227
228 @app.endpoint(class="st">"index")
229 def index():
230 return class="st">"index"
231
232 assert client.get(class="st">"/foo/").data == bclass="st">"index"
233 assert client.get(class="st">"/foo/bar").data == bclass="st">"bar"
234
235
236def test_session_accessed(app: flask.Flask, client: FlaskClient) -> None:

Callers

nothing calls this directly

Calls 2

addMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected