1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Remove setup_platform for demo (#100867)

This commit is contained in:
G Johansson
2023-10-15 23:12:41 +02:00
committed by GitHub
parent 24afbf3ae4
commit 3c3f512583
23 changed files with 149 additions and 168 deletions

View File

@@ -1,5 +1,6 @@
"""The tests for the Demo vacuum platform."""
from datetime import timedelta
from unittest.mock import patch
import pytest
@@ -35,6 +36,7 @@ from homeassistant.const import (
CONF_PLATFORM,
STATE_OFF,
STATE_ON,
Platform,
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
@@ -52,8 +54,18 @@ ENTITY_VACUUM_NONE = f"{DOMAIN}.{DEMO_VACUUM_NONE}".lower()
ENTITY_VACUUM_STATE = f"{DOMAIN}.{DEMO_VACUUM_STATE}".lower()
@pytest.fixture
async def vacuum_only() -> None:
"""Enable only the datetime platform."""
with patch(
"homeassistant.components.demo.COMPONENTS_WITH_CONFIG_ENTRY_DEMO_PLATFORM",
[Platform.VACUUM],
):
yield
@pytest.fixture(autouse=True)
async def setup_demo_vacuum(hass, disable_platforms):
async def setup_demo_vacuum(hass: HomeAssistant, vacuum_only: None):
"""Initialize setup demo vacuum."""
assert await async_setup_component(hass, DOMAIN, {DOMAIN: {CONF_PLATFORM: "demo"}})
await hass.async_block_till_done()