18
18
19
19
import pytest
20
20
21
- from toolbox_core .protocol import ParameterSchema
21
+ from toolbox_core .protocol import AdditionalPropertiesSchema , ParameterSchema
22
22
23
23
24
24
def test_parameter_schema_float ():
@@ -196,7 +196,7 @@ def test_parameter_schema_map_typed_string():
196
196
name = "headers" ,
197
197
type = "object" ,
198
198
description = "HTTP headers" ,
199
- additionalProperties = ParameterSchema ( name = "" , type = "string" , description = " " ),
199
+ additionalProperties = AdditionalPropertiesSchema ( type = "string" ),
200
200
)
201
201
expected_type = dict [str , str ]
202
202
assert schema ._ParameterSchema__get_type () == expected_type
@@ -211,7 +211,7 @@ def test_parameter_schema_map_typed_integer():
211
211
name = "user_scores" ,
212
212
type = "object" ,
213
213
description = "User scores" ,
214
- additionalProperties = ParameterSchema ( name = "" , type = "integer" , description = " " ),
214
+ additionalProperties = AdditionalPropertiesSchema ( type = "integer" ),
215
215
)
216
216
expected_type = dict [str , int ]
217
217
assert schema ._ParameterSchema__get_type () == expected_type
@@ -225,7 +225,7 @@ def test_parameter_schema_map_typed_float():
225
225
name = "item_prices" ,
226
226
type = "object" ,
227
227
description = "Item prices" ,
228
- additionalProperties = ParameterSchema ( name = "" , type = "float" , description = " " ),
228
+ additionalProperties = AdditionalPropertiesSchema ( type = "float" ),
229
229
)
230
230
expected_type = dict [str , float ]
231
231
assert schema ._ParameterSchema__get_type () == expected_type
@@ -239,7 +239,7 @@ def test_parameter_schema_map_typed_boolean():
239
239
name = "feature_flags" ,
240
240
type = "object" ,
241
241
description = "Feature flags" ,
242
- additionalProperties = ParameterSchema ( name = "" , type = "boolean" , description = " " ),
242
+ additionalProperties = AdditionalPropertiesSchema ( type = "boolean" ),
243
243
)
244
244
expected_type = dict [str , bool ]
245
245
assert schema ._ParameterSchema__get_type () == expected_type
@@ -271,9 +271,7 @@ def test_parameter_schema_map_unsupported_value_type_error():
271
271
type = "object" ,
272
272
description = "Custom data map" ,
273
273
valueType = unsupported_type ,
274
- additionalProperties = ParameterSchema (
275
- name = "" , type = unsupported_type , description = ""
276
- ),
274
+ additionalProperties = AdditionalPropertiesSchema (type = unsupported_type ),
277
275
)
278
276
expected_error_msg = f"Unsupported schema type: { unsupported_type } "
279
277
with pytest .raises (ValueError , match = expected_error_msg ):
0 commit comments