Add type hints to integration tests (part 5) (#87850)

This commit is contained in:
epenet 2023-02-12 19:39:48 +01:00 committed by GitHub
parent 00c356e1ce
commit 728f62b1ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 563 additions and 332 deletions

View file

@ -1,12 +1,11 @@
"""Test Dynalite switch."""
from unittest.mock import Mock
from dynalite_devices_lib.switch import DynalitePresetSwitchDevice
import pytest
from homeassistant.const import ATTR_FRIENDLY_NAME, STATE_OFF, STATE_ON
from homeassistant.core import State
from homeassistant.core import HomeAssistant, State
from .common import (
ATTR_METHOD,
@ -32,7 +31,7 @@ def mock_device():
return mock_dev
async def test_switch_setup(hass, mock_device):
async def test_switch_setup(hass: HomeAssistant, mock_device) -> None:
"""Test a successful setup."""
await create_entity_from_device(hass, mock_device)
entity_state = hass.states.get("switch.name")
@ -50,7 +49,9 @@ async def test_switch_setup(hass, mock_device):
@pytest.mark.parametrize("saved_state, level", [(STATE_ON, 1), (STATE_OFF, 0)])
async def test_switch_restore_state(hass, mock_device, saved_state, level):
async def test_switch_restore_state(
hass: HomeAssistant, mock_device, saved_state, level
) -> None:
"""Test restore from cache."""
mock_restore_cache(
hass,