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

Function test_multi_route_class_views

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

Source from the content-addressed store, hash-verified

1855
1856
1857def test_multi_route_class_views(app, client):
1858 class View:
1859 def __init__(self, app):
1860 app.add_url_rule("/", "index", self.index)
1861 app.add_url_rule("/<test>/", "index", self.index)
1862
1863 def index(self, test="a"):
1864 return test
1865
1866 _ = View(app)
1867 rv = client.open("/")
1868 assert rv.data == b"a"
1869 rv = client.open("/b/")
1870 assert rv.data == b"b"
1871
1872
1873def test_run_defaults(monkeypatch, app):

Callers

nothing calls this directly

Calls 2

openMethod · 0.80
ViewClass · 0.70

Tested by

no test coverage detected