| 214 | |
| 215 | |
| 216 | def 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("/foo", [Rule("/bar", endpoint="bar"), Rule("/", endpoint="index")]) |
| 222 | ) |
| 223 | |
| 224 | @app.endpoint("bar") |
| 225 | def bar(): |
| 226 | return "bar" |
| 227 | |
| 228 | @app.endpoint("index") |
| 229 | def index(): |
| 230 | return "index" |
| 231 | |
| 232 | assert client.get("/foo/").data == b"index" |
| 233 | assert client.get("/foo/bar").data == b"bar" |
| 234 | |
| 235 | |
| 236 | def test_session_accessed(app: flask.Flask, client: FlaskClient) -> None: |