|
9 | 9 | from yoti_python_sdk.activity_details import ActivityDetails |
10 | 10 | from yoti_python_sdk.crypto import Crypto |
11 | 11 | from yoti_python_sdk.endpoint import Endpoint |
12 | | -from yoti_python_sdk.http import SignedRequest |
| 12 | +from yoti_python_sdk.http import SignedRequest, YotiResponse |
13 | 13 | from yoti_python_sdk.protobuf import protobuf |
14 | 14 |
|
15 | 15 | NO_KEY_FILE_SPECIFIED_ERROR = ( |
@@ -53,6 +53,10 @@ def make_request(self, http_method, endpoint, body): |
53 | 53 | ) |
54 | 54 |
|
55 | 55 | response = signed_request.execute() |
| 56 | + |
| 57 | + if not isinstance(response, YotiResponse): |
| 58 | + raise TypeError("Response must be of type YotiResponse") |
| 59 | + |
56 | 60 | return response |
57 | 61 |
|
58 | 62 | def get_activity_details(self, encrypted_request_token): |
@@ -94,6 +98,9 @@ def perform_aml_check(self, aml_profile): |
94 | 98 |
|
95 | 99 | response = self.__make_aml_check_request(aml_profile) |
96 | 100 |
|
| 101 | + if not isinstance(response, YotiResponse): |
| 102 | + raise TypeError("Response must be of type YotiResponse") |
| 103 | + |
97 | 104 | return aml.AmlResult(response.text) |
98 | 105 |
|
99 | 106 | @property |
@@ -161,6 +168,8 @@ def __make_aml_check_request(self, aml_profile): |
161 | 168 | ) |
162 | 169 |
|
163 | 170 | response = signed_request.execute() |
| 171 | + if not isinstance(response, YotiResponse): |
| 172 | + raise TypeError("Response must be of type YotiResponse") |
164 | 173 |
|
165 | 174 | self.http_error_handler( |
166 | 175 | response, {"default": "Unsuccessful Yoti API call: {} {}"} |
|
0 commit comments