@@ -72,7 +72,8 @@ def test_search_all_params(self):
72
72
account_id = account_id ,
73
73
limit = limit ,
74
74
timeout = timeout ,
75
- sort = sort
75
+ sort = sort ,
76
+ headers = {}
76
77
)
77
78
78
79
# Check for correct operation
@@ -87,9 +88,9 @@ def test_search_all_params(self):
87
88
assert 'sort={}' .format (',' .join (sort )) in query_string
88
89
# Validate body params
89
90
req_body = json .loads (str (responses .calls [0 ].request .body , 'utf-8' ))
90
- assert req_body ['query' ] == query
91
- assert req_body ['fields' ] == fields
92
- assert req_body ['search_cursor' ] == search_cursor
91
+ assert req_body ['query' ] == 'testString'
92
+ assert req_body ['fields' ] == [ 'testString' ]
93
+ assert req_body ['search_cursor' ] == 'testString'
93
94
94
95
95
96
#--------------------------------------------------------
@@ -116,16 +117,17 @@ def test_search_required_params(self):
116
117
query = query ,
117
118
fields = fields ,
118
119
search_cursor = search_cursor ,
120
+ headers = {}
119
121
)
120
122
121
123
# Check for correct operation
122
124
assert len (responses .calls ) == 1
123
125
assert response .status_code == 200
124
126
# Validate body params
125
127
req_body = json .loads (str (responses .calls [0 ].request .body , 'utf-8' ))
126
- assert req_body ['query' ] == query
127
- assert req_body ['fields' ] == fields
128
- assert req_body ['search_cursor' ] == search_cursor
128
+ assert req_body ['query' ] == 'testString'
129
+ assert req_body ['fields' ] == [ 'testString' ]
130
+ assert req_body ['search_cursor' ] == 'testString'
129
131
130
132
131
133
# endregion
@@ -171,3 +173,109 @@ def test_get_supported_types_all_params(self):
171
173
# End of Service: ResourceTypes
172
174
##############################################################################
173
175
176
+
177
+ ##############################################################################
178
+ # Start of Model Tests
179
+ ##############################################################################
180
+ # region
181
+ #-----------------------------------------------------------------------------
182
+ # Test Class for ResultItem
183
+ #-----------------------------------------------------------------------------
184
+ class TestResultItem ():
185
+
186
+ #--------------------------------------------------------
187
+ # Test serialization/deserialization for ResultItem
188
+ #--------------------------------------------------------
189
+ def test_result_item_serialization (self ):
190
+
191
+ # Construct a json representation of a ResultItem model
192
+ result_item_model_json = {}
193
+ result_item_model_json ['crn' ] = 'testString'
194
+ result_item_model_json ['foo' ] = { 'foo' : 'bar' }
195
+
196
+ # Construct a model instance of ResultItem by calling from_dict on the json representation
197
+ result_item_model = ResultItem .from_dict (result_item_model_json )
198
+ assert result_item_model != False
199
+
200
+ # Construct a model instance of ResultItem by calling from_dict on the json representation
201
+ result_item_model_dict = ResultItem .from_dict (result_item_model_json ).__dict__
202
+ result_item_model2 = ResultItem (** result_item_model_dict )
203
+
204
+ # Verify the model instances are equivalent
205
+ assert result_item_model == result_item_model2
206
+
207
+ # Convert model instance back to dict and verify no loss of data
208
+ result_item_model_json2 = result_item_model .to_dict ()
209
+ assert result_item_model_json2 == result_item_model_json
210
+
211
+ #-----------------------------------------------------------------------------
212
+ # Test Class for ScanResult
213
+ #-----------------------------------------------------------------------------
214
+ class TestScanResult ():
215
+
216
+ #--------------------------------------------------------
217
+ # Test serialization/deserialization for ScanResult
218
+ #--------------------------------------------------------
219
+ def test_scan_result_serialization (self ):
220
+
221
+ # Construct dict forms of any model objects needed in order to build this model.
222
+
223
+ result_item_model = {} # ResultItem
224
+ result_item_model ['crn' ] = 'testString'
225
+ result_item_model ['foo' ] = { 'foo' : 'bar' }
226
+
227
+ # Construct a json representation of a ScanResult model
228
+ scan_result_model_json = {}
229
+ scan_result_model_json ['search_cursor' ] = 'testString'
230
+ scan_result_model_json ['limit' ] = 36.0
231
+ scan_result_model_json ['items' ] = [result_item_model ]
232
+
233
+ # Construct a model instance of ScanResult by calling from_dict on the json representation
234
+ scan_result_model = ScanResult .from_dict (scan_result_model_json )
235
+ assert scan_result_model != False
236
+
237
+ # Construct a model instance of ScanResult by calling from_dict on the json representation
238
+ scan_result_model_dict = ScanResult .from_dict (scan_result_model_json ).__dict__
239
+ scan_result_model2 = ScanResult (** scan_result_model_dict )
240
+
241
+ # Verify the model instances are equivalent
242
+ assert scan_result_model == scan_result_model2
243
+
244
+ # Convert model instance back to dict and verify no loss of data
245
+ scan_result_model_json2 = scan_result_model .to_dict ()
246
+ assert scan_result_model_json2 == scan_result_model_json
247
+
248
+ #-----------------------------------------------------------------------------
249
+ # Test Class for SupportedTypesList
250
+ #-----------------------------------------------------------------------------
251
+ class TestSupportedTypesList ():
252
+
253
+ #--------------------------------------------------------
254
+ # Test serialization/deserialization for SupportedTypesList
255
+ #--------------------------------------------------------
256
+ def test_supported_types_list_serialization (self ):
257
+
258
+ # Construct a json representation of a SupportedTypesList model
259
+ supported_types_list_model_json = {}
260
+ supported_types_list_model_json ['supported_types' ] = ['testString' ]
261
+
262
+ # Construct a model instance of SupportedTypesList by calling from_dict on the json representation
263
+ supported_types_list_model = SupportedTypesList .from_dict (supported_types_list_model_json )
264
+ assert supported_types_list_model != False
265
+
266
+ # Construct a model instance of SupportedTypesList by calling from_dict on the json representation
267
+ supported_types_list_model_dict = SupportedTypesList .from_dict (supported_types_list_model_json ).__dict__
268
+ supported_types_list_model2 = SupportedTypesList (** supported_types_list_model_dict )
269
+
270
+ # Verify the model instances are equivalent
271
+ assert supported_types_list_model == supported_types_list_model2
272
+
273
+ # Convert model instance back to dict and verify no loss of data
274
+ supported_types_list_model_json2 = supported_types_list_model .to_dict ()
275
+ assert supported_types_list_model_json2 == supported_types_list_model_json
276
+
277
+
278
+ # endregion
279
+ ##############################################################################
280
+ # End of Model Tests
281
+ ##############################################################################
0 commit comments