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

Function test_werkzeug_routing

tests/test_basic.py:195–213  ·  tests/test_basic.py::test_werkzeug_routing
(app, client)

Source from the content-addressed store, hash-verified

193
194
195def 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
216def test_endpoint_decorator(app, client):

Callers

nothing calls this directly

Calls 2

addMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected