File tree 1 file changed +24
-0
lines changed
tests/test_parser/test_properties
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1125,6 +1125,30 @@ def test_build_model_property_bad_prop():
1125
1125
assert err == PropertyError (detail = "unknown type not_real" , data = oai .Schema (type = "not_real" ))
1126
1126
1127
1127
1128
+ def test_build_model_property_bad_additional_props ():
1129
+ from openapi_python_client .parser .properties import Schemas , build_model_property
1130
+
1131
+ additional_properties = oai .Schema (
1132
+ type = "object" ,
1133
+ properties = {
1134
+ "bad" : oai .Schema (type = "not_real" ),
1135
+ },
1136
+ )
1137
+ data = oai .Schema (additionalProperties = additional_properties )
1138
+ schemas = Schemas (models = {"OtherModel" : None })
1139
+
1140
+ err , new_schemas = build_model_property (
1141
+ data = data ,
1142
+ name = "prop" ,
1143
+ schemas = schemas ,
1144
+ required = True ,
1145
+ parent_name = None ,
1146
+ )
1147
+
1148
+ # assert new_schemas == schemas
1149
+ assert err == PropertyError (detail = "unknown type not_real" , data = oai .Schema (type = "not_real" ))
1150
+
1151
+
1128
1152
def test_build_enum_property_conflict (mocker ):
1129
1153
from openapi_python_client .parser .properties import Schemas , build_enum_property
1130
1154
You can’t perform that action at this time.
0 commit comments