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

Function test_any_converter_build_validates_value

tests/test_routing.py:832–842  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

830
831
832def test_any_converter_build_validates_value() -> None:
833 m = r.Map([r.Rule("/<any(patient, provider):value>", endpoint="actor")])
834 a = m.bind("localhost")
835
836 assert a.build("actor", {"value": "patient"}) == "/patient"
837 assert a.build("actor", {"value": "provider"}) == "/provider"
838
839 with pytest.raises(ValueError) as exc:
840 a.build("actor", {"value": "invalid"})
841
842 assert str(exc.value) == "'invalid' is not one of 'patient', 'provider'"
843
844
845def test_part_isolating_default() -> None:

Callers

nothing calls this directly

Calls 2

bindMethod · 0.95
buildMethod · 0.45

Tested by

no test coverage detected