mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 21:40:16 +00:00
Use http.HTTPStatus in components/[tuv]* (#58325)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user