File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -222,10 +222,26 @@ def test_pickle_error(self, mock_lib):
222
222
except UnauthorizedError as e :
223
223
pickled_error = pickle .dumps (e )
224
224
unpickled_error = pickle .loads (pickled_error )
225
- self .assertDictEqual (
226
- e .__dict__ ,
227
- unpickled_error .__dict__ ,
228
- "original error and unpickled error must have the same state"
225
+
226
+ self .assertEqual (
227
+ e .status_code ,
228
+ unpickled_error .status_code ,
229
+ "unpickled error must have the same status code" ,
230
+ )
231
+ self .assertEqual (
232
+ e .reason ,
233
+ unpickled_error .reason ,
234
+ "unpickled error must have the same reason" ,
235
+ )
236
+ self .assertEqual (
237
+ e .body ,
238
+ unpickled_error .body ,
239
+ "unpickled error must have the same body" ,
240
+ )
241
+ self .assertEqual (
242
+ e .headers ,
243
+ unpickled_error .headers ,
244
+ "unpickled error must have the same headers" ,
229
245
)
230
246
231
247
You can’t perform that action at this time.
0 commit comments