Add type hints to integration tests (part 21) (#88233)

This commit is contained in:
epenet 2023-02-16 11:15:26 +01:00 committed by GitHub
parent 0748e12341
commit dab8557951
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 536 additions and 328 deletions

View file

@ -6,6 +6,7 @@ import pytest
from homeassistant.components.spaceapi import DOMAIN, SPACEAPI_VERSION, URL_API_SPACEAPI
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, PERCENTAGE, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from tests.common import mock_coro
@ -102,7 +103,7 @@ def mock_client(hass, hass_client):
return hass.loop.run_until_complete(hass_client())
async def test_spaceapi_get(hass, mock_client):
async def test_spaceapi_get(hass: HomeAssistant, mock_client) -> None:
"""Test response after start-up Home Assistant."""
resp = await mock_client.get(URL_API_SPACEAPI)
assert resp.status == HTTPStatus.OK
@ -146,7 +147,7 @@ async def test_spaceapi_get(hass, mock_client):
assert data["radio_show"][0]["end"] == "2019-09-02T12:00Z"
async def test_spaceapi_state_get(hass, mock_client):
async def test_spaceapi_state_get(hass: HomeAssistant, mock_client) -> None:
"""Test response if the state entity was set."""
hass.states.async_set("test.test_door", True)
@ -157,7 +158,7 @@ async def test_spaceapi_state_get(hass, mock_client):
assert data["state"]["open"] == bool(1)
async def test_spaceapi_sensors_get(hass, mock_client):
async def test_spaceapi_sensors_get(hass: HomeAssistant, mock_client) -> None:
"""Test the response for the sensors."""
resp = await mock_client.get(URL_API_SPACEAPI)
assert resp.status == HTTPStatus.OK