File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 1
- from bunq .sdk .exception import BadRequestException
1
+ from bunq .sdk .exception import ApiException
2
2
from bunq .sdk .model .generated .endpoint import UserPerson
3
3
from tests .bunq_test import BunqSdkTestCase
4
4
@@ -15,15 +15,12 @@ def test_bad_request_with_response_id(self):
15
15
"""
16
16
"""
17
17
18
- caught_exception = None
19
-
20
- try :
18
+ with self .assertRaises (ApiException ) as caught_exception :
21
19
UserPerson .get (
22
20
self ._get_api_context (),
23
21
self ._INVALID_USER_PERSON_ID
24
22
)
25
- except BadRequestException as exception :
26
- caught_exception = exception
27
23
28
24
self .assertIsNotNone (caught_exception )
29
- self .assertIsNotNone (caught_exception .response_id )
25
+ self .assertIsNotNone (caught_exception .exception )
26
+ self .assertIsNotNone (caught_exception .exception .response_id )
You can’t perform that action at this time.
0 commit comments