1
mirror of https://github.com/home-assistant/core synced 2024-10-07 10:13:38 +02:00

Improve blueprint test fixtures (#93519)

This commit is contained in:
Erik Montnemery 2023-05-25 13:45:19 +02:00 committed by GitHub
parent 393dbb6dc0
commit 3cca338c6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
76 changed files with 400 additions and 81 deletions

View File

@ -28,7 +28,11 @@ from tests.common import (
async_get_device_automation_capabilities,
async_get_device_automations,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.mark.parametrize(

View File

@ -27,7 +27,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -32,7 +32,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -13,7 +13,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -1,3 +1,8 @@
"""Conftest for automation tests."""
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
import pytest
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -0,0 +1,11 @@
"""Blueprints test helpers."""
from unittest.mock import patch
def stub_blueprint_populate_fixture_helper():
"""Stub copying the blueprints to the config folder."""
with patch(
"homeassistant.components.blueprint.models.DomainBlueprints.async_populate"
):
yield

View File

@ -1,14 +1,8 @@
"""Blueprints conftest."""
from unittest.mock import patch
import pytest
@pytest.fixture(autouse=True)
def stub_blueprint_populate():
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
with patch(
"homeassistant.components.blueprint.models.DomainBlueprints.async_populate"
):
yield

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.mark.parametrize(

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -27,7 +27,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -10,10 +10,14 @@ from homeassistant.components import config
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.typing import ClientSessionGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture
async def setup_automation(
hass, automation_config, stub_blueprint_populate # noqa: F811

View File

@ -7,10 +7,14 @@ from homeassistant.helpers import device_registry as dr
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry, MockModule, mock_integration
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.typing import WebSocketGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture
def client(hass, hass_ws_client):
"""Fixture that can interact with the config manager API."""

View File

@ -10,10 +10,14 @@ from homeassistant.components import config
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.typing import ClientSessionGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture(autouse=True)
async def setup_script(hass, script_config, stub_blueprint_populate): # noqa: F811
"""Set up script integration."""

View File

@ -35,6 +35,16 @@ def entity_registry_enabled_by_default() -> Generator[None, None, None]:
yield
# Blueprint test fixtures
@pytest.fixture(name="stub_blueprint_populate")
def stub_blueprint_populate_fixture():
"""Stub copying the blueprints to the config folder."""
from tests.components.blueprint.common import stub_blueprint_populate_fixture_helper
yield from stub_blueprint_populate_fixture_helper()
# TTS test fixtures
@pytest.fixture(name="mock_tts_get_cache_files")
def mock_tts_get_cache_files_fixture():
"""Mock the list TTS cache function."""

View File

@ -17,7 +17,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.mark.parametrize(

View File

@ -25,7 +25,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -28,7 +28,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -36,10 +36,14 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.test_util.aiohttp import AiohttpClientMocker
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture
def automation_calls(hass):
"""Track automation calls to a mock service."""

View File

@ -7,7 +7,10 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers import recorder as recorder_helper
from homeassistant.setup import async_setup_component
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture(autouse=True)

View File

@ -4,10 +4,14 @@ import pytest
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.components.light.conftest import mock_light_profiles # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture(autouse=True)
async def setup_homeassistant(hass: HomeAssistant):
"""Set up the homeassistant integration."""

View File

@ -28,10 +28,14 @@ from tests.common import (
mock_integration,
mock_platform,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.typing import WebSocketGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture
def fake_integration(hass):
"""Set up a mock integration with device automation support."""

View File

@ -10,7 +10,11 @@ from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
from tests.common import async_fire_time_changed, async_mock_service
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -16,7 +16,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -22,7 +22,12 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
AWAY_LATITUDE = 32.881011
AWAY_LONGITUDE = -117.234758

View File

@ -1,3 +1,8 @@
"""Conftest for emulated_hue tests."""
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
import pytest
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""

View File

@ -16,7 +16,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
async def test_get_actions(

View File

@ -16,7 +16,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -14,7 +14,11 @@ from homeassistant.core import Context, HomeAssistant
from homeassistant.setup import async_setup_component
from tests.common import async_mock_service, mock_component
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -1,3 +1,8 @@
"""Conftest for HA triggers."""
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
import pytest
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""

View File

@ -18,7 +18,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.mark.parametrize(

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -31,7 +31,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -16,7 +16,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -24,7 +24,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -14,7 +14,12 @@ import homeassistant.util.dt as dt_util
from . import async_init_integration
from tests.common import async_fire_time_changed_exact, async_mock_service
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
_LOGGER = logging.getLogger(__name__)

View File

@ -16,7 +16,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.mark.parametrize(

View File

@ -23,7 +23,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -28,7 +28,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -1,3 +1,8 @@
"""Conftest for script tests."""
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
import pytest
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""

View File

@ -24,7 +24,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -29,7 +29,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -2,10 +2,14 @@
import pytest
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.components.light.conftest import mock_light_profiles # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture(autouse=True)
def patch_hass_config(mock_hass_config: None) -> None:
"""Patch configuration.yaml."""

View File

@ -22,10 +22,14 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.typing import MqttMockHAClient, MqttMockHAClientGenerator, WebSocketGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture
def calls(hass: HomeAssistant) -> list[ServiceCall]:
"""Track calls to a mock service."""

View File

@ -9,7 +9,11 @@ from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from tests.common import async_fire_mqtt_message, async_mock_service, mock_component
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
async def test_get_actions(

View File

@ -12,7 +12,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -16,7 +16,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -1,3 +1,8 @@
"""Conftest for script tests."""
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
import pytest
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""

View File

@ -1,4 +1,6 @@
"""Tests for Search integration."""
import pytest
from homeassistant.components import search
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
@ -10,9 +12,14 @@ from homeassistant.helpers import (
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.typing import WebSocketGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
MOCK_ENTITY_SOURCES = {
"light.platform_config_source": {
"source": entity.SOURCE_PLATFORM_CONFIG,

View File

@ -26,10 +26,14 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.testing_config.custom_components.test.sensor import UNITS_OF_MEASUREMENT
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture
def calls(hass: HomeAssistant) -> list[ServiceCall]:
"""Track calls to a mock service."""

View File

@ -30,10 +30,14 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.testing_config.custom_components.test.sensor import UNITS_OF_MEASUREMENT
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture
def calls(hass: HomeAssistant) -> list[ServiceCall]:
"""Track calls to a mock service."""

View File

@ -19,7 +19,11 @@ from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
from tests.common import async_fire_time_changed, async_mock_service, mock_component
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -16,7 +16,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -9,7 +9,11 @@ from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from tests.common import async_mock_service
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -22,10 +22,14 @@ from tests.common import (
async_fire_mqtt_message,
async_get_device_automations,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.typing import MqttMockHAClient, WebSocketGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
async def test_get_triggers_btn(
hass: HomeAssistant,
device_reg,

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
async def test_get_actions(

View File

@ -1,3 +1,8 @@
"""Conftest for trace tests."""
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
import pytest
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""

View File

@ -20,7 +20,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -16,7 +16,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
async def test_get_actions(

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -21,7 +21,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture

View File

@ -16,7 +16,11 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
async def test_get_actions(

View File

@ -7,10 +7,14 @@ import pytest
from homeassistant.core import HomeAssistant, callback
from homeassistant.setup import async_setup_component
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.typing import ClientSessionGenerator
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture(autouse=True)
async def setup_http(hass):
"""Set up http."""

View File

@ -24,7 +24,12 @@ from tests.common import (
async_mock_service,
mock_coro,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
SHORT_PRESS = "remote_button_short_press"
COMMAND = "command"

View File

@ -24,7 +24,12 @@ from tests.common import (
async_get_device_automations,
async_mock_service,
)
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
ON = 1
OFF = 0

View File

@ -8,7 +8,11 @@ from homeassistant.helpers import entity_registry as er
from homeassistant.setup import async_setup_component
from tests.common import async_mock_service, mock_component
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
def stub_blueprint_populate_autouse(stub_blueprint_populate):
"""Stub copying the blueprints to the config folder."""
@pytest.fixture