|
11 | 11 | app = APIGatewayRestResolver(enable_validation=True) |
12 | 12 | app_with_custom_response_validation_error = APIGatewayRestResolver( |
13 | 13 | enable_validation=True, |
14 | | - response_validation_error_http_status=HTTPStatus.INTERNAL_SERVER_ERROR, |
| 14 | + response_validation_error_http_code=HTTPStatus.INTERNAL_SERVER_ERROR, |
15 | 15 | ) |
16 | 16 |
|
17 | 17 |
|
@@ -182,22 +182,22 @@ def handle_response_validation_error(ex: ResponseValidationError): |
182 | 182 |
|
183 | 183 | def test_incorrect_resolver_config_no_validation(self): |
184 | 184 | with pytest.raises(ValueError) as exception_info: |
185 | | - APIGatewayRestResolver(response_validation_error_http_status=500) |
| 185 | + APIGatewayRestResolver(response_validation_error_http_code=500) |
186 | 186 |
|
187 | 187 | assert ( |
188 | 188 | str(exception_info.value) |
189 | | - == "'response_validation_error_http_status' cannot be set when enable_validation is False." |
| 189 | + == "'response_validation_error_http_code' cannot be set when enable_validation is False." |
190 | 190 | ) |
191 | 191 |
|
192 | | - @pytest.mark.parametrize("response_validation_error_http_status", [(20), ("hi"), (1.21)]) |
193 | | - def test_incorrect_resolver_config_bad_http_status_code(self, response_validation_error_http_status): |
| 192 | + @pytest.mark.parametrize("response_validation_error_http_code", [(20), ("hi"), (1.21)]) |
| 193 | + def test_incorrect_resolver_config_bad_http_status_code(self, response_validation_error_http_code): |
194 | 194 | with pytest.raises(ValueError) as exception_info: |
195 | 195 | APIGatewayRestResolver( |
196 | 196 | enable_validation=True, |
197 | | - response_validation_error_http_status=response_validation_error_http_status, |
| 197 | + response_validation_error_http_code=response_validation_error_http_code, |
198 | 198 | ) |
199 | 199 |
|
200 | 200 | assert ( |
201 | 201 | str(exception_info.value) |
202 | | - == f"'{response_validation_error_http_status}' must be an integer representing an HTTP status code." |
| 202 | + == f"'{response_validation_error_http_code}' must be an integer representing an HTTP status code." |
203 | 203 | ) |
0 commit comments