mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Remove unnecessary class from wemo test_fan (#72377)
This commit is contained in:
parent
f25663067c
commit
e2a80e7a45
@ -19,6 +19,7 @@ from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_ON, STATE_OFF, STAT
|
|||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from . import entity_test_helpers
|
from . import entity_test_helpers
|
||||||
|
from .conftest import async_create_wemo_entity
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@ -161,21 +162,14 @@ async def test_fan_set_percentage(
|
|||||||
pywemo_device.set_state.assert_called_with(expected_fan_mode)
|
pywemo_device.set_state.assert_called_with(expected_fan_mode)
|
||||||
|
|
||||||
|
|
||||||
class TestInitialFanMode:
|
async def test_fan_mode_high_initially(hass, pywemo_device):
|
||||||
"""Test that the FanMode is set to High when turned on the first time."""
|
"""Verify the FanMode is set to High when turned on."""
|
||||||
|
pywemo_device.fan_mode = FanMode.Off
|
||||||
@pytest.fixture
|
wemo_entity = await async_create_wemo_entity(hass, pywemo_device, "")
|
||||||
def pywemo_device(self, pywemo_device):
|
assert await hass.services.async_call(
|
||||||
"""Set the FanMode to off initially."""
|
FAN_DOMAIN,
|
||||||
pywemo_device.fan_mode = FanMode.Off
|
SERVICE_TURN_ON,
|
||||||
yield pywemo_device
|
{ATTR_ENTITY_ID: [wemo_entity.entity_id]},
|
||||||
|
blocking=True,
|
||||||
async def test_fan_mode_high_initially(self, hass, pywemo_device, wemo_entity):
|
)
|
||||||
"""Verify the FanMode is set to High when turned on."""
|
pywemo_device.set_state.assert_called_with(FanMode.High)
|
||||||
assert await hass.services.async_call(
|
|
||||||
FAN_DOMAIN,
|
|
||||||
SERVICE_TURN_ON,
|
|
||||||
{ATTR_ENTITY_ID: [wemo_entity.entity_id]},
|
|
||||||
blocking=True,
|
|
||||||
)
|
|
||||||
pywemo_device.set_state.assert_called_with(FanMode.High)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user