Add type hints to integration tests (part 5) (#87850)
This commit is contained in:
parent
00c356e1ce
commit
728f62b1ec
50 changed files with 563 additions and 332 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue