File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -187,3 +187,52 @@ def test_clashing_names(self):
187
187
lambda d : d .startswith ('{}_def_item' .format (self .clashing_name )), self .swagger ['definitions' ].keys ()
188
188
)
189
189
self .assertEqual (len (list (defs )), 2 , 'Unexpected definitions count' )
190
+
191
+ v1_list_params = _get_parameters (self .links ['v1' ]['list' ], '' , self .definitions )
192
+ v2_list_params = _get_parameters (self .links ['v2' ]['list' ], '' , self .definitions )
193
+
194
+ expected_def_name = filter (
195
+ lambda d : d .startswith ('{}_def_item_' .format (self .clashing_name )),
196
+ self .definitions .keys ()
197
+ )[0 ]
198
+
199
+ expected_v1_list_params = [
200
+ {
201
+ 'schema' : {
202
+ 'required' : ['author' ],
203
+ 'type' : 'object' ,
204
+ 'properties' : {
205
+ 'author' : {
206
+ '$ref' : '#/definitions/author_def_item'
207
+ }
208
+ }
209
+ },
210
+ 'name' : 'data' ,
211
+ 'in' : 'body'
212
+ }
213
+ ]
214
+
215
+ expected_v2_list_params = [
216
+ {
217
+ 'schema' : {
218
+ 'required' : ['author' , 'co_authoors' ],
219
+ 'type' : 'object' ,
220
+ 'properties' : {
221
+ 'co_authoors' : {
222
+ 'items' : {
223
+ '$ref' : '#/definitions/{}' .format (expected_def_name )
224
+ },
225
+ 'type' : 'array'
226
+ },
227
+ 'author' : {
228
+ '$ref' : '#/definitions/{}' .format (expected_def_name )
229
+ }
230
+ }
231
+ },
232
+ 'name' : 'data' ,
233
+ 'in' : 'body'
234
+ }
235
+ ]
236
+
237
+ self .assertEqual (v1_list_params , expected_v1_list_params , 'Unexpected definition params' )
238
+ self .assertEqual (v2_list_params , expected_v2_list_params , 'Unexpected definition params' )
You can’t perform that action at this time.
0 commit comments