Improve type hints in gpslogger tests (#121173)

This commit is contained in:
epenet 2024-07-04 10:23:14 +02:00 committed by GitHub
parent 4589be2d11
commit c9acd1711c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,7 +45,7 @@ async def gpslogger_client(
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
async def setup_zones(hass): async def setup_zones(hass: HomeAssistant) -> None:
"""Set up Zone config in HA.""" """Set up Zone config in HA."""
assert await async_setup_component( assert await async_setup_component(
hass, hass,
@ -63,7 +63,7 @@ async def setup_zones(hass):
@pytest.fixture @pytest.fixture
async def webhook_id(hass, gpslogger_client): async def webhook_id(hass: HomeAssistant, gpslogger_client: TestClient) -> str:
"""Initialize the GPSLogger component and get the webhook_id.""" """Initialize the GPSLogger component and get the webhook_id."""
await async_process_ha_core_config( await async_process_ha_core_config(
hass, hass,
@ -81,7 +81,9 @@ async def webhook_id(hass, gpslogger_client):
return result["result"].data["webhook_id"] return result["result"].data["webhook_id"]
async def test_missing_data(hass: HomeAssistant, gpslogger_client, webhook_id) -> None: async def test_missing_data(
hass: HomeAssistant, gpslogger_client: TestClient, webhook_id: str
) -> None:
"""Test missing data.""" """Test missing data."""
url = f"/api/webhook/{webhook_id}" url = f"/api/webhook/{webhook_id}"
@ -111,8 +113,8 @@ async def test_enter_and_exit(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry: er.EntityRegistry, entity_registry: er.EntityRegistry,
device_registry: dr.DeviceRegistry, device_registry: dr.DeviceRegistry,
gpslogger_client, gpslogger_client: TestClient,
webhook_id, webhook_id: str,
) -> None: ) -> None:
"""Test when there is a known zone.""" """Test when there is a known zone."""
url = f"/api/webhook/{webhook_id}" url = f"/api/webhook/{webhook_id}"
@ -148,7 +150,7 @@ async def test_enter_and_exit(
async def test_enter_with_attrs( async def test_enter_with_attrs(
hass: HomeAssistant, gpslogger_client, webhook_id hass: HomeAssistant, gpslogger_client: TestClient, webhook_id: str
) -> None: ) -> None:
"""Test when additional attributes are present.""" """Test when additional attributes are present."""
url = f"/api/webhook/{webhook_id}" url = f"/api/webhook/{webhook_id}"
@ -210,7 +212,7 @@ async def test_enter_with_attrs(
reason="The device_tracker component does not support unloading yet." reason="The device_tracker component does not support unloading yet."
) )
async def test_load_unload_entry( async def test_load_unload_entry(
hass: HomeAssistant, gpslogger_client, webhook_id hass: HomeAssistant, gpslogger_client: TestClient, webhook_id: str
) -> None: ) -> None:
"""Test that the appropriate dispatch signals are added and removed.""" """Test that the appropriate dispatch signals are added and removed."""
url = f"/api/webhook/{webhook_id}" url = f"/api/webhook/{webhook_id}"