MCPcopy Create free account
hub / github.com/pallets/flask / test_multi_route_class_views

Function test_multi_route_class_views

tests/test_basic.py:1829–1842  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

1827
1828
1829def test_multi_route_class_views(app, client):
1830 class View:
1831 def __init__(self, app):
1832 app.add_url_rule("/", "index", self.index)
1833 app.add_url_rule("/<test>/", "index", self.index)
1834
1835 def index(self, test="a"):
1836 return test
1837
1838 _ = View(app)
1839 rv = client.open("/")
1840 assert rv.data == b"a"
1841 rv = client.open("/b/")
1842 assert rv.data == b"b"
1843
1844
1845def test_run_defaults(monkeypatch, app):

Callers

nothing calls this directly

Calls 2

openMethod · 0.80
ViewClass · 0.70

Tested by

no test coverage detected