9
9
from openapi_schema_validator import OAS31Validator
10
10
11
11
from openapi_core .spec .paths import Spec
12
- from openapi_core .unmarshalling .schemas .enums import UnmarshalContext
12
+ from openapi_core .unmarshalling .schemas .enums import ValidationContext
13
13
from openapi_core .unmarshalling .schemas .exceptions import (
14
14
FormatterNotFoundError ,
15
15
)
@@ -866,9 +866,9 @@ def test_read_only_properties(self, unmarshaller_factory):
866
866
spec = Spec .from_dict (schema , validator = None )
867
867
868
868
# readOnly properties may be admitted in a Response context
869
- result = unmarshaller_factory (spec , context = UnmarshalContext . RESPONSE )(
870
- { "id" : 10 }
871
- )
869
+ result = unmarshaller_factory (
870
+ spec , context = ValidationContext . RESPONSE
871
+ )({ "id" : 10 })
872
872
873
873
assert result == {
874
874
"id" : 10 ,
@@ -889,7 +889,7 @@ def test_read_only_properties_invalid(self, unmarshaller_factory):
889
889
890
890
# readOnly properties are not admitted on a Request context
891
891
with pytest .raises (InvalidSchemaValue ):
892
- unmarshaller_factory (spec , context = UnmarshalContext .REQUEST )(
892
+ unmarshaller_factory (spec , context = ValidationContext .REQUEST )(
893
893
{"id" : 10 }
894
894
)
895
895
@@ -907,7 +907,7 @@ def test_write_only_properties(self, unmarshaller_factory):
907
907
spec = Spec .from_dict (schema , validator = None )
908
908
909
909
# readOnly properties may be admitted in a Response context
910
- result = unmarshaller_factory (spec , context = UnmarshalContext .REQUEST )(
910
+ result = unmarshaller_factory (spec , context = ValidationContext .REQUEST )(
911
911
{"id" : 10 }
912
912
)
913
913
@@ -930,17 +930,17 @@ def test_write_only_properties_invalid(self, unmarshaller_factory):
930
930
931
931
# readOnly properties are not admitted on a Request context
932
932
with pytest .raises (InvalidSchemaValue ):
933
- unmarshaller_factory (spec , context = UnmarshalContext .RESPONSE )(
933
+ unmarshaller_factory (spec , context = ValidationContext .RESPONSE )(
934
934
{"id" : 10 }
935
935
)
936
936
937
937
def test_additional_properties_list (self , unmarshaller_factory ):
938
938
schema = {"type" : "object" }
939
939
spec = Spec .from_dict (schema , validator = None )
940
940
941
- result = unmarshaller_factory (spec , context = UnmarshalContext . RESPONSE )(
942
- { "user_ids" : [ 1 , 2 , 3 , 4 ]}
943
- )
941
+ result = unmarshaller_factory (
942
+ spec , context = ValidationContext . RESPONSE
943
+ )({ "user_ids" : [ 1 , 2 , 3 , 4 ]})
944
944
945
945
assert result == {
946
946
"user_ids" : [1 , 2 , 3 , 4 ],
0 commit comments