Improve type hints in geofency tests (#121168)

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

View File

@ -137,7 +137,7 @@ async def geofency_client(
@pytest.fixture(autouse=True)
async def setup_zones(hass):
async def setup_zones(hass: HomeAssistant) -> None:
"""Set up Zone config in HA."""
assert await async_setup_component(
hass,
@ -155,7 +155,7 @@ async def setup_zones(hass):
@pytest.fixture
async def webhook_id(hass, geofency_client):
async def webhook_id(hass: HomeAssistant) -> str:
"""Initialize the Geofency component and get the webhook_id."""
await async_process_ha_core_config(
hass,
@ -173,7 +173,7 @@ async def webhook_id(hass, geofency_client):
return result["result"].data["webhook_id"]
async def test_data_validation(geofency_client, webhook_id) -> None:
async def test_data_validation(geofency_client: TestClient, webhook_id: str) -> None:
"""Test data validation."""
url = f"/api/webhook/{webhook_id}"
@ -195,8 +195,8 @@ async def test_gps_enter_and_exit_home(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
device_registry: dr.DeviceRegistry,
geofency_client,
webhook_id,
geofency_client: TestClient,
webhook_id: str,
) -> None:
"""Test GPS based zone enter and exit."""
url = f"/api/webhook/{webhook_id}"
@ -240,7 +240,7 @@ async def test_gps_enter_and_exit_home(
async def test_beacon_enter_and_exit_home(
hass: HomeAssistant, geofency_client, webhook_id
hass: HomeAssistant, geofency_client: TestClient, webhook_id: str
) -> None:
"""Test iBeacon based zone enter and exit - a.k.a stationary iBeacon."""
url = f"/api/webhook/{webhook_id}"
@ -263,7 +263,7 @@ async def test_beacon_enter_and_exit_home(
async def test_beacon_enter_and_exit_car(
hass: HomeAssistant, geofency_client, webhook_id
hass: HomeAssistant, geofency_client: TestClient, webhook_id: str
) -> None:
"""Test use of mobile iBeacon."""
url = f"/api/webhook/{webhook_id}"
@ -305,7 +305,7 @@ async def test_beacon_enter_and_exit_car(
async def test_load_unload_entry(
hass: HomeAssistant, geofency_client, webhook_id
hass: HomeAssistant, geofency_client: TestClient, webhook_id: str
) -> None:
"""Test that the appropriate dispatch signals are added and removed."""
url = f"/api/webhook/{webhook_id}"