Use HTTPStatus instead of HTTP_* constants in various test mocks (#56543)
This commit is contained in:
parent
e5b0bbcca6
commit
2730a27fd0
9 changed files with 59 additions and 59 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue