@@ -1068,27 +1068,35 @@ def test_get_additional_properties_exception(self, dictionary):
10681068 assert result == {} # expected result when exception occurs
10691069
10701070 @pytest .mark .parametrize (
1071- "value, unboxing_function, is_array, is_dict, is_array_of_map, is_map_of_array, expected" ,
1071+ "value, unboxing_function, is_array, is_dict, is_array_of_map, is_map_of_array, dimension_count, expected" ,
10721072 [
10731073 # Test case 1: Simple object
1074- (5 , lambda x : x * 2 , False , False , False , False , 10 ),
1074+ (5 , lambda x : x * 2 , False , False , False , False , 0 , 10 ),
10751075 # Test case 2: Array
1076- ([1 , 2 , 3 ], lambda x : x * 2 , True , False , False , False , [2 , 4 , 6 ]),
1076+ ([1 , 2 , 3 ], lambda x : x * 2 , True , False , False , False , 0 , [2 , 4 , 6 ]),
10771077 # Test case 3: Dictionary
1078- ({"a" : 1 , "b" : 2 }, lambda x : x * 2 , False , True , False , False , {"a" : 2 , "b" : 4 }),
1078+ ({"a" : 1 , "b" : 2 }, lambda x : x * 2 , False , True , False , False , 0 , {"a" : 2 , "b" : 4 }),
10791079 # Test case 4: Array of maps
1080- ([{"a" : 1 }, {"b" : 2 }], lambda x : x * 2 , True , False , True , False , [{"a" : 2 }, {"b" : 4 }]),
1080+ ([{"a" : 1 }, {"b" : 2 }], lambda x : x * 2 , True , False , True , False , 0 , [{"a" : 2 }, {"b" : 4 }]),
10811081 # Test case 5: Map of arrays
1082- ({"a" : [1 , 2 ], "b" : [3 , 4 ]}, lambda x : x * 2 , False , True , False , True , {"a" : [2 , 4 ], "b" : [6 , 8 ]}),
1082+ ({"a" : [1 , 2 ], "b" : [3 , 4 ]}, lambda x : x * 2 , False , True , False , True , 0 , {"a" : [2 , 4 ], "b" : [6 , 8 ]}),
1083+ # Test case 6: Multi-dimensional array
1084+ ([[1 ], [2 , 3 ], [4 ]], lambda x : x * 2 , True , False , False , False , 2 , [[2 ], [4 , 6 ], [8 ]]),
1085+ # Test case 7: Array of arrays
1086+ ([[1 , 2 ], [3 , 4 ]], lambda x : x * 2 , True , False , False , False , 2 , [[2 , 4 ], [6 , 8 ]]),
1087+ # Test case 8: Array of arrays of arrays
1088+ ([[[1 , 2 ], [3 , 4 ]], [[5 , 6 ], [7 , 8 ]]], lambda x : x * 2 , True , False , False , False , 3 ,
1089+ [[[2 , 4 ], [6 , 8 ]], [[10 , 12 ], [14 , 16 ]]]),
10831090 ],
10841091 )
10851092 def test_apply_unboxing_function (self , value , unboxing_function , is_array , is_dict ,
1086- is_array_of_map , is_map_of_array , expected ):
1093+ is_array_of_map , is_map_of_array , dimension_count , expected ):
10871094 result = ApiHelper .apply_unboxing_function (
10881095 value ,
10891096 unboxing_function ,
10901097 is_array ,
10911098 is_dict ,
10921099 is_array_of_map ,
1093- is_map_of_array )
1100+ is_map_of_array ,
1101+ dimension_count )
10941102 assert result == expected
0 commit comments