MCPcopy
hub / github.com/pallets/werkzeug / test_build_values_multidict

Function test_build_values_multidict

tests/test_routing.py:902–917  ·  view source on GitHub ↗
(endpoint, value, expect)

Source from the content-addressed store, hash-verified

900 ],
901)
902def test_build_values_multidict(endpoint, value, expect):
903 class ListConverter(r.BaseConverter):
904 def to_url(self, value: t.Any) -> str:
905 return super().to_url(".".join(map(str, value)))
906
907 url_map = r.Map(
908 [r.Rule("/<int:v>", endpoint="int"), r.Rule("/<list:v>", endpoint="list")],
909 converters={"list": ListConverter},
910 )
911 adapter = url_map.bind("localhost")
912
913 if isinstance(expect, str):
914 assert adapter.build(endpoint, MultiDict({"v": value})) == expect
915 else:
916 with pytest.raises(expect):
917 adapter.build(endpoint, MultiDict({"v": value}))
918
919
920@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

bindMethod · 0.95
MultiDictClass · 0.90
buildMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…