Improve type hints in locative tests (#123643)

pull/123674/head^2
epenet 2024-08-12 21:55:44 +02:00 committed by GitHub
parent b0d1d7bdb2
commit 416d2fb82a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 7 deletions

View File

@ -38,7 +38,7 @@ async def locative_client(
@pytest.fixture
async def webhook_id(hass, locative_client):
async def webhook_id(hass: HomeAssistant, locative_client: TestClient) -> str:
"""Initialize the Geofency component and get the webhook_id."""
await async_process_ha_core_config(
hass,
@ -56,7 +56,7 @@ async def webhook_id(hass, locative_client):
return result["result"].data["webhook_id"]
async def test_missing_data(locative_client, webhook_id) -> None:
async def test_missing_data(locative_client: TestClient, webhook_id: str) -> None:
"""Test missing data."""
url = f"/api/webhook/{webhook_id}"
@ -116,7 +116,9 @@ async def test_missing_data(locative_client, webhook_id) -> None:
assert req.status == HTTPStatus.UNPROCESSABLE_ENTITY
async def test_enter_and_exit(hass: HomeAssistant, locative_client, webhook_id) -> None:
async def test_enter_and_exit(
hass: HomeAssistant, locative_client: TestClient, webhook_id: str
) -> None:
"""Test when there is a known zone."""
url = f"/api/webhook/{webhook_id}"
@ -186,7 +188,7 @@ async def test_enter_and_exit(hass: HomeAssistant, locative_client, webhook_id)
async def test_exit_after_enter(
hass: HomeAssistant, locative_client, webhook_id
hass: HomeAssistant, locative_client: TestClient, webhook_id: str
) -> None:
"""Test when an exit message comes after an enter message."""
url = f"/api/webhook/{webhook_id}"
@ -229,7 +231,9 @@ async def test_exit_after_enter(
assert state.state == "work"
async def test_exit_first(hass: HomeAssistant, locative_client, webhook_id) -> None:
async def test_exit_first(
hass: HomeAssistant, locative_client: TestClient, webhook_id: str
) -> None:
"""Test when an exit message is sent first on a new device."""
url = f"/api/webhook/{webhook_id}"
@ -250,7 +254,9 @@ async def test_exit_first(hass: HomeAssistant, locative_client, webhook_id) -> N
assert state.state == "not_home"
async def test_two_devices(hass: HomeAssistant, locative_client, webhook_id) -> None:
async def test_two_devices(
hass: HomeAssistant, locative_client: TestClient, webhook_id: str
) -> None:
"""Test updating two different devices."""
url = f"/api/webhook/{webhook_id}"
@ -294,7 +300,7 @@ async def test_two_devices(hass: HomeAssistant, locative_client, webhook_id) ->
reason="The device_tracker component does not support unloading yet."
)
async def test_load_unload_entry(
hass: HomeAssistant, locative_client, webhook_id
hass: HomeAssistant, locative_client: TestClient, webhook_id: str
) -> None:
"""Test that the appropriate dispatch signals are added and removed."""
url = f"/api/webhook/{webhook_id}"