99from openapi_schema_validator import OAS31Validator
1010
1111from openapi_core .spec .paths import Spec
12- from openapi_core .unmarshalling .schemas .enums import UnmarshalContext
12+ from openapi_core .unmarshalling .schemas .enums import ValidationContext
1313from openapi_core .unmarshalling .schemas .exceptions import (
1414 FormatterNotFoundError ,
1515)
@@ -866,9 +866,9 @@ def test_read_only_properties(self, unmarshaller_factory):
866866 spec = Spec .from_dict (schema , validator = None )
867867
868868 # 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 })
872872
873873 assert result == {
874874 "id" : 10 ,
@@ -889,7 +889,7 @@ def test_read_only_properties_invalid(self, unmarshaller_factory):
889889
890890 # readOnly properties are not admitted on a Request context
891891 with pytest .raises (InvalidSchemaValue ):
892- unmarshaller_factory (spec , context = UnmarshalContext .REQUEST )(
892+ unmarshaller_factory (spec , context = ValidationContext .REQUEST )(
893893 {"id" : 10 }
894894 )
895895
@@ -907,7 +907,7 @@ def test_write_only_properties(self, unmarshaller_factory):
907907 spec = Spec .from_dict (schema , validator = None )
908908
909909 # 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 )(
911911 {"id" : 10 }
912912 )
913913
@@ -930,17 +930,17 @@ def test_write_only_properties_invalid(self, unmarshaller_factory):
930930
931931 # readOnly properties are not admitted on a Request context
932932 with pytest .raises (InvalidSchemaValue ):
933- unmarshaller_factory (spec , context = UnmarshalContext .RESPONSE )(
933+ unmarshaller_factory (spec , context = ValidationContext .RESPONSE )(
934934 {"id" : 10 }
935935 )
936936
937937 def test_additional_properties_list (self , unmarshaller_factory ):
938938 schema = {"type" : "object" }
939939 spec = Spec .from_dict (schema , validator = None )
940940
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 ]})
944944
945945 assert result == {
946946 "user_ids" : [1 , 2 , 3 , 4 ],
0 commit comments