File tree 1 file changed +16
-0
lines changed
tests/test_parser/test_properties
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,22 @@ def test_get_base_type_string(self, mocker):
313
313
)
314
314
assert p .get_base_type_string () == "Union[inner_type_string_1, inner_type_string_2]"
315
315
316
+ def test_get_base_type_string_one_element (self , mocker ):
317
+ from openapi_python_client .parser .properties import UnionProperty
318
+
319
+ inner_property_1 = mocker .MagicMock ()
320
+ inner_property_1 .get_type_string .side_effect = (
321
+ lambda no_optional = False , json = False : "inner_json_type_string_1" if json else "inner_type_string_1"
322
+ )
323
+ p = UnionProperty (
324
+ name = "test" ,
325
+ required = False ,
326
+ default = None ,
327
+ inner_properties = [inner_property_1 ],
328
+ nullable = True ,
329
+ )
330
+ assert p .get_base_type_string () == "inner_type_string_1"
331
+
316
332
def test_get_base_json_type_string (self , mocker ):
317
333
from openapi_python_client .parser .properties import UnionProperty
318
334
You can’t perform that action at this time.
0 commit comments