@@ -127,8 +127,7 @@ def process_type(type_spec: Any) -> Any:
127127 defined types.
128128
129129 Args:
130- type_spec (Any): A type specification which might be a string,
131- dict, or list
130+ type_spec (Any): A type specification which might be a str, dict, or list
132131
133132 Returns:
134133 Any: An appropriate test value for the specified type
@@ -171,7 +170,7 @@ def process_type(type_spec: Any) -> Any:
171170 # Array type (list)
172171 elif type_name == "array" :
173172 items = type_spec .get ("items" )
174- # We crate a list with a single element
173+ # We create a list with a single element
175174 return [process_type (items )]
176175
177176 # Map type (dictionary/object)
@@ -267,6 +266,10 @@ def generate_test_event_data_for_data_type(data_type: Any) -> dict: # pragma: n
267266
268267 item_type = args [0 ]
269268
269+ # Handle List of simple types, e.g. List[str]
270+ if item_type in defaults_per_type :
271+ return [defaults_per_type [item_type ]]
272+
270273 # Handle List of Dicts, e.g. List[Dict[str, str]]
271274 if get_origin (item_type ) is dict :
272275 dict_key_type , dict_value_type = get_args (item_type )
@@ -285,10 +288,6 @@ def generate_test_event_data_for_data_type(data_type: Any) -> dict: # pragma: n
285288
286289 return [sample_dict ]
287290
288- # Handle List of simple types, e.g. List[str]
289- if item_type in defaults_per_type :
290- return [defaults_per_type [item_type ]]
291-
292291 # Handle List of attrs classes, e.g. List[EventData]
293292 item_data = generate_test_event_data_for_data_type (item_type )
294293 return [item_data ]
0 commit comments