MCPcopy Create free account
hub / github.com/pallets/flask / test_endpoint_decorator

Function test_endpoint_decorator

tests/test_basic.py:214–231  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

212
213
214def test_endpoint_decorator(app, client):
215 from werkzeug.routing import Rule
216 from werkzeug.routing import Submount
217
218 app.url_map.add(
219 Submount("/foo", [Rule("/bar", endpoint="bar"), Rule("/", endpoint="index")])
220 )
221
222 @app.endpoint("bar")
223 def bar():
224 return "bar"
225
226 @app.endpoint("index")
227 def index():
228 return "index"
229
230 assert client.get("/foo/").data == b"index"
231 assert client.get("/foo/bar").data == b"bar"
232
233
234def test_session(app, client):

Callers

nothing calls this directly

Calls 2

addMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected