Use HTTPStatus instead of HTTP_* constants in various test mocks (#56543)

This commit is contained in:
Ville Skyttä 2021-10-02 01:52:45 +03:00 committed by GitHub
parent e5b0bbcca6
commit 2730a27fd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 59 additions and 59 deletions

View file

@ -1,5 +1,6 @@
"""Tests for the HTTP API for the cloud component."""
import asyncio
from http import HTTPStatus
from ipaddress import ip_network
from unittest.mock import AsyncMock, MagicMock, Mock, patch
@ -412,7 +413,7 @@ async def test_websocket_subscription_fail(
hass, hass_ws_client, aioclient_mock, mock_auth, mock_cloud_login
):
"""Test querying the status."""
aioclient_mock.get(SUBSCRIPTION_INFO_URL, status=HTTP_INTERNAL_SERVER_ERROR)
aioclient_mock.get(SUBSCRIPTION_INFO_URL, status=HTTPStatus.INTERNAL_SERVER_ERROR)
client = await hass_ws_client(hass)
await client.send_json({"id": 5, "type": "cloud/subscription"})
response = await client.receive_json()