(app, client)
| 293 | |
| 294 | |
| 295 | def test_route_decorator_custom_endpoint(app, client): |
| 296 | bp = flask.Blueprint("bp", __name__) |
| 297 | |
| 298 | @bp.route("/foo") |
| 299 | def foo(): |
| 300 | return flask.request.endpoint |
| 301 | |
| 302 | @bp.route("/bar", endpoint="bar") |
| 303 | def foo_bar(): |
| 304 | return flask.request.endpoint |
| 305 | |
| 306 | @bp.route("/bar/123", endpoint="123") |
| 307 | def foo_bar_foo(): |
| 308 | return flask.request.endpoint |
| 309 | |
| 310 | @bp.route("/bar/foo") |
| 311 | def bar_foo(): |
| 312 | return flask.request.endpoint |
| 313 | |
| 314 | app.register_blueprint(bp, url_prefix="/py") |
| 315 | |
| 316 | @app.route("/") |
| 317 | def index(): |
| 318 | return flask.request.endpoint |
| 319 | |
| 320 | assert client.get("/").data == b"index" |
| 321 | assert client.get("/py/foo").data == b"bp.foo" |
| 322 | assert client.get("/py/bar").data == b"bp.bar" |
| 323 | assert client.get("/py/bar/123").data == b"bp.123" |
| 324 | assert client.get("/py/bar/foo").data == b"bp.bar_foo" |
| 325 | |
| 326 | |
| 327 | def test_route_decorator_custom_endpoint_with_dots(app, client): |
nothing calls this directly
no test coverage detected
searching dependent graphs…