Add type hints to integration tests (part 23) (#88235)

This commit is contained in:
epenet 2023-02-17 16:40:46 +01:00 committed by GitHub
parent aa50096a31
commit 9a5f88f55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 651 additions and 408 deletions

View file

@ -112,7 +112,9 @@ async def test_no_clients(
assert len(hass.states.async_entity_ids(SENSOR_DOMAIN)) == 0
async def test_bandwidth_sensors(hass, aioclient_mock, mock_unifi_websocket):
async def test_bandwidth_sensors(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, mock_unifi_websocket
) -> None:
"""Verify that bandwidth sensors are working as expected."""
wired_client = {
"hostname": "Wired client",
@ -192,14 +194,14 @@ async def test_bandwidth_sensors(hass, aioclient_mock, mock_unifi_websocket):
],
)
async def test_uptime_sensors(
hass,
aioclient_mock,
hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker,
mock_unifi_websocket,
entity_registry_enabled_by_default,
initial_uptime,
event_uptime,
new_uptime,
):
) -> None:
"""Verify that uptime sensors are working as expected."""
uptime_client = {
"mac": "00:00:00:00:00:01",
@ -267,8 +269,11 @@ async def test_uptime_sensors(
async def test_remove_sensors(
hass, aioclient_mock, mock_unifi_websocket, entity_registry_enabled_by_default
):
hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker,
mock_unifi_websocket,
entity_registry_enabled_by_default,
) -> None:
"""Verify removing of clients work as expected."""
wired_client = {
"hostname": "Wired client",
@ -325,7 +330,9 @@ async def test_remove_sensors(
assert hass.states.get("sensor.wireless_client_uptime")
async def test_poe_port_switches(hass, aioclient_mock, mock_unifi_websocket):
async def test_poe_port_switches(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, mock_unifi_websocket
) -> None:
"""Test the update_items function with some clients."""
await setup_unifi_integration(hass, aioclient_mock, devices_response=[DEVICE_1])
assert len(hass.states.async_entity_ids(SENSOR_DOMAIN)) == 0