Add type hints to integration tests (zha) (#88309)

This commit is contained in:
epenet 2023-02-17 18:54:26 +01:00 committed by GitHub
parent 185cd61cbd
commit 7427d4f323
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 411 additions and 238 deletions

View file

@ -1,5 +1,4 @@
"""Test ZHA select entities."""
from unittest.mock import call, patch
import pytest
@ -9,6 +8,7 @@ import zigpy.zcl.clusters.general as general
import zigpy.zcl.clusters.security as security
from homeassistant.const import STATE_UNKNOWN, EntityCategory, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er, restore_state
from homeassistant.util import dt as dt_util
@ -107,7 +107,7 @@ def core_rs(hass_storage):
return _storage
async def test_select(hass, siren):
async def test_select(hass: HomeAssistant, siren) -> None:
"""Test ZHA select platform."""
entity_registry = er.async_get(hass)
@ -155,11 +155,11 @@ async def test_select(hass, siren):
async def test_select_restore_state(
hass,
hass: HomeAssistant,
zigpy_device_mock,
core_rs,
zha_device_restored,
):
) -> None:
"""Test ZHA select entity restore state."""
entity_id = "select.fakemanufacturer_fakemodel_default_siren_tone"
@ -192,7 +192,9 @@ async def test_select_restore_state(
assert state.state == security.IasWd.Warning.WarningMode.Burglar.name
async def test_on_off_select_new_join(hass, light, zha_device_joined):
async def test_on_off_select_new_join(
hass: HomeAssistant, light, zha_device_joined
) -> None:
"""Test ZHA on off select - new join."""
entity_registry = er.async_get(hass)
@ -251,7 +253,9 @@ async def test_on_off_select_new_join(hass, light, zha_device_joined):
assert state.state == general.OnOff.StartUpOnOff.Off.name
async def test_on_off_select_restored(hass, light, zha_device_restored):
async def test_on_off_select_restored(
hass: HomeAssistant, light, zha_device_restored
) -> None:
"""Test ZHA on off select - restored."""
entity_registry = er.async_get(hass)
@ -303,7 +307,9 @@ async def test_on_off_select_restored(hass, light, zha_device_restored):
assert entity_entry.entity_category == EntityCategory.CONFIG
async def test_on_off_select_unsupported(hass, light, zha_device_joined_restored):
async def test_on_off_select_unsupported(
hass: HomeAssistant, light, zha_device_joined_restored
) -> None:
"""Test ZHA on off select unsupported."""
on_off_cluster = light.endpoints[1].on_off