Add type hints to rest tests (#81304)
This commit is contained in:
parent
82151bfd40
commit
a0ed91e30c
5 changed files with 130 additions and 74 deletions
|
@ -15,6 +15,7 @@ from homeassistant.const import (
|
|||
SERVICE_RELOAD,
|
||||
STATE_UNAVAILABLE,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
|
@ -22,7 +23,7 @@ from tests.common import async_fire_time_changed, get_fixture_path
|
|||
|
||||
|
||||
@respx.mock
|
||||
async def test_setup_with_endpoint_timeout_with_recovery(hass):
|
||||
async def test_setup_with_endpoint_timeout_with_recovery(hass: HomeAssistant) -> None:
|
||||
"""Test setup with an endpoint that times out that recovers."""
|
||||
await async_setup_component(hass, "homeassistant", {})
|
||||
|
||||
|
@ -129,7 +130,7 @@ async def test_setup_with_endpoint_timeout_with_recovery(hass):
|
|||
|
||||
|
||||
@respx.mock
|
||||
async def test_setup_minimum_resource_template(hass):
|
||||
async def test_setup_minimum_resource_template(hass: HomeAssistant) -> None:
|
||||
"""Test setup with minimum configuration (resource_template)."""
|
||||
|
||||
respx.get("http://localhost").respond(
|
||||
|
@ -187,7 +188,7 @@ async def test_setup_minimum_resource_template(hass):
|
|||
|
||||
|
||||
@respx.mock
|
||||
async def test_reload(hass):
|
||||
async def test_reload(hass: HomeAssistant) -> None:
|
||||
"""Verify we can reload."""
|
||||
|
||||
respx.get("http://localhost") % HTTPStatus.OK
|
||||
|
@ -236,7 +237,7 @@ async def test_reload(hass):
|
|||
|
||||
|
||||
@respx.mock
|
||||
async def test_reload_and_remove_all(hass):
|
||||
async def test_reload_and_remove_all(hass: HomeAssistant) -> None:
|
||||
"""Verify we can reload and remove all."""
|
||||
|
||||
respx.get("http://localhost") % HTTPStatus.OK
|
||||
|
@ -283,7 +284,7 @@ async def test_reload_and_remove_all(hass):
|
|||
|
||||
|
||||
@respx.mock
|
||||
async def test_reload_fails_to_read_configuration(hass):
|
||||
async def test_reload_fails_to_read_configuration(hass: HomeAssistant) -> None:
|
||||
"""Verify reload when configuration is missing or broken."""
|
||||
|
||||
respx.get("http://localhost") % HTTPStatus.OK
|
||||
|
@ -327,7 +328,7 @@ async def test_reload_fails_to_read_configuration(hass):
|
|||
|
||||
|
||||
@respx.mock
|
||||
async def test_multiple_rest_endpoints(hass):
|
||||
async def test_multiple_rest_endpoints(hass: HomeAssistant) -> None:
|
||||
"""Test multiple rest endpoints."""
|
||||
|
||||
respx.get("http://date.jsontest.com").respond(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue