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

Function test_empty_url_defaults

tests/test_blueprints.py:281–292  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

279
280
281def test_empty_url_defaults(app, client):
282 bp = flask.Blueprint("bp", __name__)
283
284 @bp.route("/", defaults={"page": 1})
285 @bp.route("/page/<int:page>")
286 def something(page):
287 return str(page)
288
289 app.register_blueprint(bp)
290
291 assert client.get("/").data == b"1"
292 assert client.get("/page/2").data == b"2"
293
294
295def test_route_decorator_custom_endpoint(app, client):

Callers

nothing calls this directly

Calls 2

register_blueprintMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…