@@ -291,8 +291,11 @@ def test_get_visits_bad_text_data(self):
291
291
mock_pool .expect_request ('GET' , TestFingerprintApi .get_visitors_path (visitor_id = mocked_id ),
292
292
fields = [self .integration_info ], headers = self .request_headers ,
293
293
preload_content = True , timeout = None )
294
- with self .assertRaises (ValueError ) :
294
+ with self .assertRaises (ApiException ) as context :
295
295
self .api .get_visits (mocked_id )
296
+ self .assertEqual (context .exception .status , 200 )
297
+ self .assertIsInstance (context .exception .reason , ValueError )
298
+ self .assertEqual (context .exception .body , 'really bad data' )
296
299
297
300
def test_get_visits_bad_json_data (self ):
298
301
"""Test checks exception raising when client receives a bad JSON answer"""
@@ -302,8 +305,11 @@ def test_get_visits_bad_json_data(self):
302
305
mock_pool .expect_request ('GET' , TestFingerprintApi .get_visitors_path (visitor_id = mocked_id ),
303
306
fields = [self .integration_info ], headers = self .request_headers ,
304
307
preload_content = True , timeout = None )
305
- with self .assertRaises (ValueError ) :
308
+ with self .assertRaises (ApiException ) as context :
306
309
self .api .get_visits (mocked_id )
310
+ self .assertEqual (context .exception .status , 200 )
311
+ self .assertIsInstance (context .exception .reason , ValueError )
312
+ self .assertEqual (context .exception .body , '{}' )
307
313
308
314
def test_init_with_us_region (self ):
309
315
"""Test that link for us region generates correct"""
0 commit comments