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,12 +1,9 @@
"""Tests for the Start.ca sensor platform."""
from http import HTTPStatus
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.startca.sensor import StartcaData
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
DATA_GIGABYTES,
HTTP_NOT_FOUND,
PERCENTAGE,
)
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, DATA_GIGABYTES, PERCENTAGE
from homeassistant.helpers.aiohttp_client import async_get_clientsession
@ -205,7 +202,8 @@ async def test_unlimited_setup(hass, aioclient_mock):
async def test_bad_return_code(hass, aioclient_mock):
"""Test handling a return code that isn't HTTP OK."""
aioclient_mock.get(
"https://www.start.ca/support/usage/api?key=NOTAKEY", status=HTTP_NOT_FOUND
"https://www.start.ca/support/usage/api?key=NOTAKEY",
status=HTTPStatus.NOT_FOUND,
)
scd = StartcaData(hass.loop, async_get_clientsession(hass), "NOTAKEY", 400)