Use http.HTTPStatus in components/s* (#58291)

This commit is contained in:
Ville Skyttä 2021-10-23 21:49:04 +03:00 committed by GitHub
parent 05671557f0
commit 50e0c58310
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 180 additions and 158 deletions

View file

@ -551,7 +551,10 @@ async def test_webhook_problem_shows_error(hass, smartthings_mock):
data = {"error": {}}
request_info = Mock(real_url="http://example.com")
error = APIResponseError(
request_info=request_info, history=None, data=data, status=422
request_info=request_info,
history=None,
data=data,
status=HTTPStatus.UNPROCESSABLE_ENTITY,
)
error.is_target_error = Mock(return_value=True)
smartthings_mock.apps.side_effect = error
@ -591,7 +594,10 @@ async def test_api_error_shows_error(hass, smartthings_mock):
data = {"error": {}}
request_info = Mock(real_url="http://example.com")
error = APIResponseError(
request_info=request_info, history=None, data=data, status=400
request_info=request_info,
history=None,
data=data,
status=HTTPStatus.BAD_REQUEST,
)
smartthings_mock.apps.side_effect = error