1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +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,4 +1,6 @@
"""The tests for the demo remote component."""
from unittest.mock import patch
import pytest
import homeassistant.components.remote as remote
@@ -9,6 +11,7 @@ from homeassistant.const import (
SERVICE_TURN_ON,
STATE_OFF,
STATE_ON,
Platform,
)
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
@@ -17,8 +20,18 @@ ENTITY_ID = "remote.remote_one"
SERVICE_SEND_COMMAND = "send_command"
@pytest.fixture
async def remote_only() -> None:
"""Enable only the datetime platform."""
with patch(
"homeassistant.components.demo.COMPONENTS_WITH_CONFIG_ENTRY_DEMO_PLATFORM",
[Platform.REMOTE],
):
yield
@pytest.fixture(autouse=True)
async def setup_component(hass, disable_platforms):
async def setup_component(hass: HomeAssistant, remote_only: None):
"""Initialize components."""
assert await async_setup_component(
hass, remote.DOMAIN, {"remote": {"platform": "demo"}}