Apply hass-relative-import to tests (i-r) (#78732)
This commit is contained in:
parent
a809e18559
commit
00dd27ef1b
47 changed files with 90 additions and 59 deletions
|
@ -24,8 +24,9 @@ from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.const import ATTR_ASSUMED_STATE, STATE_ON, STATE_UNAVAILABLE
|
from homeassistant.const import ATTR_ASSUMED_STATE, STATE_ON, STATE_UNAVAILABLE
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
|
from .conftest import get_aqualink_device, get_aqualink_system
|
||||||
|
|
||||||
from tests.common import async_fire_time_changed
|
from tests.common import async_fire_time_changed
|
||||||
from tests.components.iaqualink.conftest import get_aqualink_device, get_aqualink_system
|
|
||||||
|
|
||||||
|
|
||||||
async def _ffwd_next_update_interval(hass):
|
async def _ffwd_next_update_interval(hass):
|
||||||
|
|
|
@ -6,7 +6,7 @@ import pytest
|
||||||
from homeassistant.components.iaqualink.utils import await_or_reraise
|
from homeassistant.components.iaqualink.utils import await_or_reraise
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
|
||||||
from tests.components.iaqualink.conftest import async_raises, async_returns
|
from .conftest import async_raises, async_returns
|
||||||
|
|
||||||
|
|
||||||
async def test_await_or_reraise(hass):
|
async def test_await_or_reraise(hass):
|
||||||
|
|
|
@ -9,8 +9,9 @@ from homeassistant.const import ATTR_ENTITY_PICTURE
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
from . import common
|
||||||
|
|
||||||
from tests.common import assert_setup_component, async_capture_events
|
from tests.common import assert_setup_component, async_capture_events
|
||||||
from tests.components.image_processing import common
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
|
@ -11,8 +11,9 @@ from homeassistant.const import CONF_API_KEY, CONF_HOST, CONF_PASSWORD, CONF_USE
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.data_entry_flow import FlowResultType
|
from homeassistant.data_entry_flow import FlowResultType
|
||||||
|
|
||||||
|
from .conftest import mock_api_connection_error
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.intellifire.conftest import mock_api_connection_error
|
|
||||||
|
|
||||||
|
|
||||||
@patch.multiple(
|
@patch.multiple(
|
||||||
|
|
|
@ -3,7 +3,8 @@ from homeassistant.components.ipp.const import DOMAIN
|
||||||
from homeassistant.config_entries import ConfigEntryState
|
from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from tests.components.ipp import init_integration
|
from . import init_integration
|
||||||
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,8 @@ from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
from tests.components.ipp import init_integration, mock_connection
|
from . import init_integration, mock_connection
|
||||||
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,10 @@ from homeassistant.components.knx.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
from .conftest import KNXTestKit
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||||
from tests.components.knx.conftest import KNXTestKit
|
|
||||||
|
|
||||||
|
|
||||||
async def test_diagnostics(
|
async def test_diagnostics(
|
||||||
|
|
|
@ -19,7 +19,7 @@ from homeassistant.components.minio import (
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from tests.components.minio.common import TEST_EVENT
|
from .common import TEST_EVENT
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="minio_client")
|
@pytest.fixture(name="minio_client")
|
||||||
|
|
|
@ -5,7 +5,8 @@ from homeassistant.const import ATTR_ICON
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
from tests.components.modern_forms import init_integration
|
from . import init_integration
|
||||||
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,8 @@ from homeassistant.const import (
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
from tests.components.modern_forms import init_integration
|
from . import init_integration
|
||||||
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,8 @@ from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
from tests.components.modern_forms import (
|
from . import init_integration, modern_forms_no_light_call_mock
|
||||||
init_integration,
|
|
||||||
modern_forms_no_light_call_mock,
|
|
||||||
)
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,8 @@ from homeassistant.const import (
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
from tests.components.modern_forms import init_integration
|
from . import init_integration
|
||||||
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,8 @@ from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_ICON
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
from tests.components.modern_forms import init_integration, modern_forms_timers_set_mock
|
from . import init_integration, modern_forms_timers_set_mock
|
||||||
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@ from homeassistant.const import (
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
from tests.components.modern_forms import init_integration
|
from . import init_integration
|
||||||
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_ENTITY_ID, STATE_UNKNOWN
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
from tests.components.nam import init_integration
|
from . import init_integration
|
||||||
|
|
||||||
|
|
||||||
async def test_button(hass):
|
async def test_button(hass):
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
"""Test NAM diagnostics."""
|
"""Test NAM diagnostics."""
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from . import init_integration
|
||||||
|
|
||||||
from tests.common import load_fixture
|
from tests.common import load_fixture
|
||||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||||
from tests.components.nam import init_integration
|
|
||||||
|
|
||||||
|
|
||||||
async def test_entry_diagnostics(hass, hass_client):
|
async def test_entry_diagnostics(hass, hass_client):
|
||||||
|
|
|
@ -9,8 +9,9 @@ from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.const import STATE_UNAVAILABLE
|
from homeassistant.const import STATE_UNAVAILABLE
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
|
from . import init_integration
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.nam import init_integration
|
|
||||||
|
|
||||||
|
|
||||||
async def test_async_setup_entry(hass):
|
async def test_async_setup_entry(hass):
|
||||||
|
|
|
@ -28,10 +28,9 @@ from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
from homeassistant.util.dt import utcnow
|
from homeassistant.util.dt import utcnow
|
||||||
|
|
||||||
from . import INCOMPLETE_NAM_DATA, nam_data
|
from . import INCOMPLETE_NAM_DATA, init_integration, nam_data
|
||||||
|
|
||||||
from tests.common import async_fire_time_changed
|
from tests.common import async_fire_time_changed
|
||||||
from tests.components.nam import init_integration
|
|
||||||
|
|
||||||
|
|
||||||
async def test_sensor(hass):
|
async def test_sensor(hass):
|
||||||
|
|
|
@ -7,9 +7,10 @@ from aiohttp import ClientSession
|
||||||
from homeassistant.components.diagnostics import REDACTED
|
from homeassistant.components.diagnostics import REDACTED
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
from . import init_integration
|
||||||
|
|
||||||
from tests.common import load_fixture
|
from tests.common import load_fixture
|
||||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||||
from tests.components.nextdns import init_integration
|
|
||||||
|
|
||||||
|
|
||||||
async def test_entry_diagnostics(
|
async def test_entry_diagnostics(
|
||||||
|
|
|
@ -9,12 +9,9 @@ from homeassistant.components.nightscout.const import DOMAIN
|
||||||
from homeassistant.components.nightscout.utils import hash_from_url
|
from homeassistant.components.nightscout.utils import hash_from_url
|
||||||
from homeassistant.const import CONF_URL
|
from homeassistant.const import CONF_URL
|
||||||
|
|
||||||
|
from . import GLUCOSE_READINGS, SERVER_STATUS, SERVER_STATUS_STATUS_ONLY
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.nightscout import (
|
|
||||||
GLUCOSE_READINGS,
|
|
||||||
SERVER_STATUS,
|
|
||||||
SERVER_STATUS_STATUS_ONLY,
|
|
||||||
)
|
|
||||||
|
|
||||||
CONFIG = {CONF_URL: "https://some.url:1234"}
|
CONFIG = {CONF_URL: "https://some.url:1234"}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,9 @@ from homeassistant.components.nightscout.const import DOMAIN
|
||||||
from homeassistant.config_entries import ConfigEntryState
|
from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.const import CONF_URL
|
from homeassistant.const import CONF_URL
|
||||||
|
|
||||||
|
from . import init_integration
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.nightscout import init_integration
|
|
||||||
|
|
||||||
|
|
||||||
async def test_unload_entry(hass):
|
async def test_unload_entry(hass):
|
||||||
|
|
|
@ -7,7 +7,7 @@ from homeassistant.components.nightscout.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.const import ATTR_DATE, ATTR_ICON, STATE_UNAVAILABLE
|
from homeassistant.const import ATTR_DATE, ATTR_ICON, STATE_UNAVAILABLE
|
||||||
|
|
||||||
from tests.components.nightscout import (
|
from . import (
|
||||||
GLUCOSE_READINGS,
|
GLUCOSE_READINGS,
|
||||||
init_integration,
|
init_integration,
|
||||||
init_integration_empty_response,
|
init_integration_empty_response,
|
||||||
|
|
|
@ -3,7 +3,7 @@ from unittest.mock import AsyncMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from tests.components.nws.const import DEFAULT_FORECAST, DEFAULT_OBSERVATION
|
from .const import DEFAULT_FORECAST, DEFAULT_OBSERVATION
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
|
|
|
@ -3,8 +3,9 @@ from homeassistant.components.nws.const import DOMAIN
|
||||||
from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN
|
from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN
|
||||||
from homeassistant.const import STATE_UNAVAILABLE
|
from homeassistant.const import STATE_UNAVAILABLE
|
||||||
|
|
||||||
|
from .const import NWS_CONFIG
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.nws.const import NWS_CONFIG
|
|
||||||
|
|
||||||
|
|
||||||
async def test_unload_entry(hass, mock_simple_nws):
|
async def test_unload_entry(hass, mock_simple_nws):
|
||||||
|
|
|
@ -8,8 +8,7 @@ from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
from homeassistant.util.unit_system import IMPERIAL_SYSTEM, METRIC_SYSTEM
|
from homeassistant.util.unit_system import IMPERIAL_SYSTEM, METRIC_SYSTEM
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from .const import (
|
||||||
from tests.components.nws.const import (
|
|
||||||
EXPECTED_FORECAST_IMPERIAL,
|
EXPECTED_FORECAST_IMPERIAL,
|
||||||
EXPECTED_FORECAST_METRIC,
|
EXPECTED_FORECAST_METRIC,
|
||||||
NONE_OBSERVATION,
|
NONE_OBSERVATION,
|
||||||
|
@ -18,6 +17,8 @@ from tests.components.nws.const import (
|
||||||
SENSOR_EXPECTED_OBSERVATION_METRIC,
|
SENSOR_EXPECTED_OBSERVATION_METRIC,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"units,result_observation,result_forecast",
|
"units,result_observation,result_forecast",
|
||||||
|
|
|
@ -17,8 +17,7 @@ from homeassistant.setup import async_setup_component
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.util.unit_system import IMPERIAL_SYSTEM, METRIC_SYSTEM
|
from homeassistant.util.unit_system import IMPERIAL_SYSTEM, METRIC_SYSTEM
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, async_fire_time_changed
|
from .const import (
|
||||||
from tests.components.nws.const import (
|
|
||||||
EXPECTED_FORECAST_IMPERIAL,
|
EXPECTED_FORECAST_IMPERIAL,
|
||||||
EXPECTED_FORECAST_METRIC,
|
EXPECTED_FORECAST_METRIC,
|
||||||
NONE_FORECAST,
|
NONE_FORECAST,
|
||||||
|
@ -28,6 +27,8 @@ from tests.components.nws.const import (
|
||||||
WEATHER_EXPECTED_OBSERVATION_METRIC,
|
WEATHER_EXPECTED_OBSERVATION_METRIC,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from tests.common import MockConfigEntry, async_fire_time_changed
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"units,result_observation,result_forecast",
|
"units,result_observation,result_forecast",
|
||||||
|
|
|
@ -29,8 +29,9 @@ from homeassistant.const import (
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
|
|
||||||
|
from .const import MOCK_VEHICLES
|
||||||
|
|
||||||
from tests.common import load_fixture
|
from tests.common import load_fixture
|
||||||
from tests.components.renault.const import MOCK_VEHICLES
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.usefixtures("patch_renault_account", "patch_get_vehicles")
|
pytestmark = pytest.mark.usefixtures("patch_renault_account", "patch_get_vehicles")
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,9 @@ from homeassistant.const import (
|
||||||
from homeassistant.core import CoreState, State, callback
|
from homeassistant.core import CoreState, State, callback
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
|
from .test_init import mock_rflink
|
||||||
|
|
||||||
from tests.common import async_fire_time_changed, mock_restore_cache
|
from tests.common import async_fire_time_changed, mock_restore_cache
|
||||||
from tests.components.rflink.test_init import mock_rflink
|
|
||||||
|
|
||||||
DOMAIN = "binary_sensor"
|
DOMAIN = "binary_sensor"
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,9 @@ from homeassistant.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.core import CoreState, State, callback
|
from homeassistant.core import CoreState, State, callback
|
||||||
|
|
||||||
|
from .test_init import mock_rflink
|
||||||
|
|
||||||
from tests.common import mock_restore_cache
|
from tests.common import mock_restore_cache
|
||||||
from tests.components.rflink.test_init import mock_rflink
|
|
||||||
|
|
||||||
DOMAIN = "cover"
|
DOMAIN = "cover"
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,9 @@ from homeassistant.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.core import CoreState, State, callback
|
from homeassistant.core import CoreState, State, callback
|
||||||
|
|
||||||
|
from .test_init import mock_rflink
|
||||||
|
|
||||||
from tests.common import mock_restore_cache
|
from tests.common import mock_restore_cache
|
||||||
from tests.components.rflink.test_init import mock_rflink
|
|
||||||
|
|
||||||
DOMAIN = "light"
|
DOMAIN = "light"
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ from homeassistant.const import (
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
)
|
)
|
||||||
|
|
||||||
from tests.components.rflink.test_init import mock_rflink
|
from .test_init import mock_rflink
|
||||||
|
|
||||||
DOMAIN = "sensor"
|
DOMAIN = "sensor"
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,9 @@ from homeassistant.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.core import CoreState, State, callback
|
from homeassistant.core import CoreState, State, callback
|
||||||
|
|
||||||
|
from .test_init import mock_rflink
|
||||||
|
|
||||||
from tests.common import mock_restore_cache
|
from tests.common import mock_restore_cache
|
||||||
from tests.components.rflink.test_init import mock_rflink
|
|
||||||
|
|
||||||
DOMAIN = "switch"
|
DOMAIN = "switch"
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,9 @@ from homeassistant.components.rfxtrx.const import ATTR_EVENT
|
||||||
from homeassistant.const import STATE_UNKNOWN
|
from homeassistant.const import STATE_UNKNOWN
|
||||||
from homeassistant.core import State
|
from homeassistant.core import State
|
||||||
|
|
||||||
|
from .conftest import create_rfx_test_cfg
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, mock_restore_cache
|
from tests.common import MockConfigEntry, mock_restore_cache
|
||||||
from tests.components.rfxtrx.conftest import create_rfx_test_cfg
|
|
||||||
|
|
||||||
EVENT_SMOKE_DETECTOR_PANIC = "08200300a109000670"
|
EVENT_SMOKE_DETECTOR_PANIC = "08200300a109000670"
|
||||||
EVENT_SMOKE_DETECTOR_NO_PANIC = "08200300a109000770"
|
EVENT_SMOKE_DETECTOR_NO_PANIC = "08200300a109000770"
|
||||||
|
|
|
@ -7,8 +7,9 @@ from homeassistant.components.rfxtrx import DOMAIN
|
||||||
from homeassistant.core import State
|
from homeassistant.core import State
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
|
||||||
|
from .conftest import create_rfx_test_cfg
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, mock_restore_cache
|
from tests.common import MockConfigEntry, mock_restore_cache
|
||||||
from tests.components.rfxtrx.conftest import create_rfx_test_cfg
|
|
||||||
|
|
||||||
|
|
||||||
async def test_one_cover(hass, rfxtrx):
|
async def test_one_cover(hass, rfxtrx):
|
||||||
|
|
|
@ -12,6 +12,8 @@ from homeassistant.components.rfxtrx import DOMAIN
|
||||||
from homeassistant.helpers.device_registry import DeviceRegistry
|
from homeassistant.helpers.device_registry import DeviceRegistry
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
from .conftest import create_rfx_test_cfg
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import (
|
||||||
MockConfigEntry,
|
MockConfigEntry,
|
||||||
assert_lists_same,
|
assert_lists_same,
|
||||||
|
@ -19,7 +21,6 @@ from tests.common import (
|
||||||
mock_device_registry,
|
mock_device_registry,
|
||||||
mock_registry,
|
mock_registry,
|
||||||
)
|
)
|
||||||
from tests.components.rfxtrx.conftest import create_rfx_test_cfg
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="device_reg")
|
@pytest.fixture(name="device_reg")
|
||||||
|
|
|
@ -11,6 +11,8 @@ from homeassistant.components.rfxtrx import DOMAIN
|
||||||
from homeassistant.helpers.device_registry import DeviceRegistry
|
from homeassistant.helpers.device_registry import DeviceRegistry
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
from .conftest import create_rfx_test_cfg
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import (
|
||||||
MockConfigEntry,
|
MockConfigEntry,
|
||||||
assert_lists_same,
|
assert_lists_same,
|
||||||
|
@ -18,7 +20,6 @@ from tests.common import (
|
||||||
async_mock_service,
|
async_mock_service,
|
||||||
mock_device_registry,
|
mock_device_registry,
|
||||||
)
|
)
|
||||||
from tests.components.rfxtrx.conftest import create_rfx_test_cfg
|
|
||||||
|
|
||||||
|
|
||||||
class EventTestData(NamedTuple):
|
class EventTestData(NamedTuple):
|
||||||
|
|
|
@ -11,8 +11,9 @@ from homeassistant.core import callback
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
from .conftest import create_rfx_test_cfg, setup_rfx_test_cfg
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.rfxtrx.conftest import create_rfx_test_cfg, setup_rfx_test_cfg
|
|
||||||
|
|
||||||
SOME_PROTOCOLS = ["ac", "arc"]
|
SOME_PROTOCOLS = ["ac", "arc"]
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,9 @@ from homeassistant.components.rfxtrx import DOMAIN
|
||||||
from homeassistant.const import STATE_UNKNOWN
|
from homeassistant.const import STATE_UNKNOWN
|
||||||
from homeassistant.core import State
|
from homeassistant.core import State
|
||||||
|
|
||||||
|
from .conftest import create_rfx_test_cfg
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, mock_restore_cache
|
from tests.common import MockConfigEntry, mock_restore_cache
|
||||||
from tests.components.rfxtrx.conftest import create_rfx_test_cfg
|
|
||||||
|
|
||||||
|
|
||||||
async def test_one_light(hass, rfxtrx):
|
async def test_one_light(hass, rfxtrx):
|
||||||
|
|
|
@ -11,8 +11,9 @@ from homeassistant.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.core import State
|
from homeassistant.core import State
|
||||||
|
|
||||||
|
from .conftest import create_rfx_test_cfg
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, mock_restore_cache
|
from tests.common import MockConfigEntry, mock_restore_cache
|
||||||
from tests.components.rfxtrx.conftest import create_rfx_test_cfg
|
|
||||||
|
|
||||||
|
|
||||||
async def test_default_config(hass, rfxtrx):
|
async def test_default_config(hass, rfxtrx):
|
||||||
|
|
|
@ -8,8 +8,9 @@ from homeassistant.components.rfxtrx import DOMAIN
|
||||||
from homeassistant.const import STATE_UNKNOWN
|
from homeassistant.const import STATE_UNKNOWN
|
||||||
from homeassistant.core import State
|
from homeassistant.core import State
|
||||||
|
|
||||||
|
from .conftest import create_rfx_test_cfg
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, mock_restore_cache
|
from tests.common import MockConfigEntry, mock_restore_cache
|
||||||
from tests.components.rfxtrx.conftest import create_rfx_test_cfg
|
|
||||||
|
|
||||||
EVENT_RFY_ENABLE_SUN_AUTO = "0C1a0000030101011300000003"
|
EVENT_RFY_ENABLE_SUN_AUTO = "0C1a0000030101011300000003"
|
||||||
EVENT_RFY_DISABLE_SUN_AUTO = "0C1a0000030101011400000003"
|
EVENT_RFY_DISABLE_SUN_AUTO = "0C1a0000030101011400000003"
|
||||||
|
|
|
@ -11,8 +11,9 @@ from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
|
|
||||||
|
from . import UPNP_SERIAL
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.roku import UPNP_SERIAL
|
|
||||||
|
|
||||||
|
|
||||||
async def test_roku_binary_sensors(
|
async def test_roku_binary_sensors(
|
||||||
|
|
|
@ -11,8 +11,7 @@ from homeassistant.const import CONF_HOST, CONF_NAME, CONF_SOURCE
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.data_entry_flow import FlowResultType
|
from homeassistant.data_entry_flow import FlowResultType
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from . import (
|
||||||
from tests.components.roku import (
|
|
||||||
HOMEKIT_HOST,
|
HOMEKIT_HOST,
|
||||||
HOST,
|
HOST,
|
||||||
MOCK_HOMEKIT_DISCOVERY_INFO,
|
MOCK_HOMEKIT_DISCOVERY_INFO,
|
||||||
|
@ -21,6 +20,8 @@ from tests.components.roku import (
|
||||||
UPNP_FRIENDLY_NAME,
|
UPNP_FRIENDLY_NAME,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
|
||||||
async def test_duplicate_error(
|
async def test_duplicate_error(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
|
|
@ -10,8 +10,9 @@ from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_O
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
|
from . import UPNP_SERIAL
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.roku import UPNP_SERIAL
|
|
||||||
|
|
||||||
MAIN_ENTITY_ID = f"{REMOTE_DOMAIN}.my_roku_3"
|
MAIN_ENTITY_ID = f"{REMOTE_DOMAIN}.my_roku_3"
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,9 @@ from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
|
|
||||||
|
from . import UPNP_SERIAL
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.roku import UPNP_SERIAL
|
|
||||||
|
|
||||||
|
|
||||||
async def test_roku_sensors(
|
async def test_roku_sensors(
|
||||||
|
|
|
@ -8,8 +8,9 @@ from homeassistant import config_entries
|
||||||
from homeassistant.components.ruckus_unleashed.const import DOMAIN
|
from homeassistant.components.ruckus_unleashed.const import DOMAIN
|
||||||
from homeassistant.util import utcnow
|
from homeassistant.util import utcnow
|
||||||
|
|
||||||
|
from . import CONFIG, DEFAULT_SYSTEM_INFO, DEFAULT_TITLE
|
||||||
|
|
||||||
from tests.common import async_fire_time_changed
|
from tests.common import async_fire_time_changed
|
||||||
from tests.components.ruckus_unleashed import CONFIG, DEFAULT_SYSTEM_INFO, DEFAULT_TITLE
|
|
||||||
|
|
||||||
|
|
||||||
async def test_form(hass):
|
async def test_form(hass):
|
||||||
|
|
|
@ -8,8 +8,7 @@ from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.helpers.entity_component import async_update_entity
|
from homeassistant.helpers.entity_component import async_update_entity
|
||||||
from homeassistant.util import utcnow
|
from homeassistant.util import utcnow
|
||||||
|
|
||||||
from tests.common import async_fire_time_changed
|
from . import (
|
||||||
from tests.components.ruckus_unleashed import (
|
|
||||||
DEFAULT_AP_INFO,
|
DEFAULT_AP_INFO,
|
||||||
DEFAULT_SYSTEM_INFO,
|
DEFAULT_SYSTEM_INFO,
|
||||||
DEFAULT_TITLE,
|
DEFAULT_TITLE,
|
||||||
|
@ -20,6 +19,8 @@ from tests.components.ruckus_unleashed import (
|
||||||
mock_config_entry,
|
mock_config_entry,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from tests.common import async_fire_time_changed
|
||||||
|
|
||||||
|
|
||||||
async def test_client_connected(hass):
|
async def test_client_connected(hass):
|
||||||
"""Test client connected."""
|
"""Test client connected."""
|
||||||
|
|
|
@ -18,7 +18,7 @@ from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
|
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
|
||||||
|
|
||||||
from tests.components.ruckus_unleashed import (
|
from . import (
|
||||||
DEFAULT_AP_INFO,
|
DEFAULT_AP_INFO,
|
||||||
DEFAULT_SYSTEM_INFO,
|
DEFAULT_SYSTEM_INFO,
|
||||||
DEFAULT_TITLE,
|
DEFAULT_TITLE,
|
||||||
|
|
Loading…
Add table
Reference in a new issue