(app, client)
| 212 | |
| 213 | |
| 214 | def 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 | |
| 234 | def test_session(app, client): |