@@ -20,25 +20,35 @@ def _with(path: tuple[str | int, ...], value: str) -> LocalizationList:
2020
2121
2222def test_get_ura_rejects_a_missing_ura_identifier () -> None :
23+ resource = _with ((* URA , "system" ), "urn:wrong" )
24+
2325 with pytest .raises (InvalidResourceError , match = "Missing identifier" ):
24- _with (( * URA , "system" ), "urn:wrong" ) .get_ura ()
26+ resource .get_ura ()
2527
2628
2729def test_get_ura_rejects_an_invalid_ura () -> None :
30+ resource = _with ((* URA , "value" ), "not-a-ura" )
31+
2832 with pytest .raises (InvalidResourceError , match = "Invalid URA in List.extension" ):
29- _with (( * URA , "value" ), "not-a-ura" ) .get_ura ()
33+ resource .get_ura ()
3034
3135
3236def test_get_encoded_pseudonym_rejects_a_wrong_system () -> None :
37+ resource = _with (("subject" , "identifier" , "system" ), "urn:wrong" )
38+
3339 with pytest .raises (InvalidResourceError , match = "List.subject.identifier.system" ):
34- _with (( "subject" , "identifier" , "system" ), "urn:wrong" ) .get_encoded_pseudonym ()
40+ resource .get_encoded_pseudonym ()
3541
3642
3743def test_get_encoded_pseudonym_rejects_a_missing_subject () -> None :
44+ resource = make_list_resource (pseudonym = None )
45+
3846 with pytest .raises (InvalidResourceError , match = "List.subject is required" ):
39- make_list_resource ( pseudonym = None ) .get_encoded_pseudonym ()
47+ resource .get_encoded_pseudonym ()
4048
4149
4250def test_get_device_rejects_a_wrong_system () -> None :
51+ resource = _with (("source" , "identifier" , "system" ), "urn:wrong" )
52+
4353 with pytest .raises (InvalidResourceError , match = "List.source.identifier" ):
44- _with (( "source" , "identifier" , "system" ), "urn:wrong" ) .get_device ()
54+ resource .get_device ()
0 commit comments