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

Function test_empty_url_defaults

tests/test_blueprints.py:281–292  ·  tests/test_blueprints.py::test_empty_url_defaults
(app, client)

Source from the content-addressed store, hash-verified

279
280
281def test_empty_url_defaults(app, client):
282 bp = flask.Blueprint(class="st">"bp", __name__)
283
284 @bp.route(class="st">"/", defaults={class="st">"page": 1})
285 @bp.route(class="st">"/page/<int:page>")
286 def something(page):
287 return str(page)
288
289 app.register_blueprint(bp)
290
291 assert client.get(class="st">"/").data == bclass="st">"1"
292 assert client.get(class="st">"/page/2").data == bclass="st">"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