1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Migrate input_* tests from coroutine to async/await (#30336)

This commit is contained in:
Franck Nijhof
2020-01-01 01:22:44 +01:00
committed by Martin Hjelmare
parent fc23b4f83f
commit 52ed9608e2
5 changed files with 25 additions and 50 deletions

View File

@@ -1,6 +1,5 @@
"""The tests for the Input select component."""
# pylint: disable=protected-access
import asyncio
from unittest.mock import patch
import pytest
@@ -249,8 +248,7 @@ async def test_set_options_service(hass):
assert "test2" == state.state
@asyncio.coroutine
def test_restore_state(hass):
async def test_restore_state(hass):
"""Ensure states are restored on startup."""
mock_restore_cache(
hass,
@@ -262,9 +260,7 @@ def test_restore_state(hass):
options = {"options": ["first option", "middle option", "last option"]}
yield from async_setup_component(
hass, DOMAIN, {DOMAIN: {"s1": options, "s2": options}}
)
await async_setup_component(hass, DOMAIN, {DOMAIN: {"s1": options, "s2": options}})
state = hass.states.get("input_select.s1")
assert state
@@ -275,8 +271,7 @@ def test_restore_state(hass):
assert state.state == "first option"
@asyncio.coroutine
def test_initial_state_overrules_restore_state(hass):
async def test_initial_state_overrules_restore_state(hass):
"""Ensure states are restored on startup."""
mock_restore_cache(
hass,
@@ -291,9 +286,7 @@ def test_initial_state_overrules_restore_state(hass):
"initial": "middle option",
}
yield from async_setup_component(
hass, DOMAIN, {DOMAIN: {"s1": options, "s2": options}}
)
await async_setup_component(hass, DOMAIN, {DOMAIN: {"s1": options, "s2": options}})
state = hass.states.get("input_select.s1")
assert state