| 193 | |
| 194 | |
| 195 | def test_werkzeug_routing(app, client): |
| 196 | from werkzeug.routing import Rule |
| 197 | from werkzeug.routing import Submount |
| 198 | |
| 199 | app.url_map.add( |
| 200 | Submount(class="st">"/foo", [Rule(class="st">"/bar", endpoint=class="st">"bar"), Rule(class="st">"/", endpoint=class="st">"index")]) |
| 201 | ) |
| 202 | |
| 203 | def bar(): |
| 204 | return class="st">"bar" |
| 205 | |
| 206 | def index(): |
| 207 | return class="st">"index" |
| 208 | |
| 209 | app.view_functions[class="st">"bar"] = bar |
| 210 | app.view_functions[class="st">"index"] = index |
| 211 | |
| 212 | assert client.get(class="st">"/foo/").data == bclass="st">"index" |
| 213 | assert client.get(class="st">"/foo/bar").data == bclass="st">"bar" |
| 214 | |
| 215 | |
| 216 | def test_endpoint_decorator(app, client): |