| 830 | |
| 831 | |
| 832 | def 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 | |
| 845 | def test_part_isolating_default() -> None: |