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

Various light test improvements (#34131)

This commit is contained in:
Franck Nijhof
2020-04-13 15:33:04 +02:00
committed by GitHub
parent 4bcceb4078
commit 6d24a65313
7 changed files with 418 additions and 259 deletions

View File

@@ -4,6 +4,7 @@ import pytest
from homeassistant.components import light, switch
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_PLATFORM,
SERVICE_TURN_ON,
STATE_ON,
@@ -19,7 +20,6 @@ from tests.common import (
async_mock_service,
mock_restore_cache,
)
from tests.components.light import common as common_light
from tests.components.switch import common
@@ -897,9 +897,13 @@ async def test_flux_with_multiple_lights(hass):
)
ent1, ent2, ent3 = platform.ENTITIES
common_light.turn_on(hass, entity_id=ent2.entity_id)
await hass.async_block_till_done()
common_light.turn_on(hass, entity_id=ent3.entity_id)
await hass.services.async_call(
light.DOMAIN, SERVICE_TURN_ON, {ATTR_ENTITY_ID: ent2.entity_id}, blocking=True
)
await hass.services.async_call(
light.DOMAIN, SERVICE_TURN_ON, {ATTR_ENTITY_ID: ent3.entity_id}, blocking=True
)
await hass.async_block_till_done()
state = hass.states.get(ent1.entity_id)