Use http.HTTPStatus in components/[tuv]* (#58325)

This commit is contained in:
Ville Skyttä 2021-10-24 12:27:17 +03:00 committed by GitHub
parent 45a98aee10
commit cc0c79ac9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 69 additions and 57 deletions

View file

@ -3,6 +3,7 @@
import asyncio
from copy import deepcopy
from datetime import timedelta
from http import HTTPStatus
from unittest.mock import Mock, patch
import aiounifi
@ -404,7 +405,9 @@ async def test_reconnect_mechanism(hass, aioclient_mock, mock_unifi_websocket):
await setup_unifi_integration(hass, aioclient_mock)
aioclient_mock.clear_requests()
aioclient_mock.post(f"https://{DEFAULT_HOST}:1234/api/login", status=502)
aioclient_mock.post(
f"https://{DEFAULT_HOST}:1234/api/login", status=HTTPStatus.BAD_GATEWAY
)
mock_unifi_websocket(state=STATE_DISCONNECTED)
await hass.async_block_till_done()