Use http.HTTPStatus in components/[tuv]* (#58325)
This commit is contained in:
parent
45a98aee10
commit
cc0c79ac9a
14 changed files with 69 additions and 57 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue