Add type hints to integration tests (part 21) (#88233)

This commit is contained in:
epenet 2023-02-16 11:15:26 +01:00 committed by GitHub
parent 0748e12341
commit dab8557951
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 536 additions and 328 deletions

View file

@ -4,10 +4,13 @@ import pytest
from homeassistant import core
from homeassistant.components import switch
from homeassistant.const import CONF_PLATFORM
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from . import common
from tests.common import MockUser
@pytest.fixture(autouse=True)
def entities(hass):
@ -17,7 +20,9 @@ def entities(hass):
return platform.ENTITIES
async def test_methods(hass, entities, enable_custom_integrations):
async def test_methods(
hass: HomeAssistant, entities, enable_custom_integrations: None
) -> None:
"""Test is_on, turn_on, turn_off methods."""
switch_1, switch_2, switch_3 = entities
assert await async_setup_component(
@ -50,8 +55,11 @@ async def test_methods(hass, entities, enable_custom_integrations):
async def test_switch_context(
hass, entities, hass_admin_user, enable_custom_integrations
):
hass: HomeAssistant,
entities,
hass_admin_user: MockUser,
enable_custom_integrations: None,
) -> None:
"""Test that switch context works."""
assert await async_setup_component(hass, "switch", {"switch": {"platform": "test"}})