mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Use relative imports in tests [s-z] (#119283)
This commit is contained in:
parent
ac588ddc75
commit
2e3c3789d3
@ -7,8 +7,9 @@ from unittest.mock import AsyncMock
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import setup_integration
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.sanix import setup_integration
|
||||
|
||||
|
||||
async def test_load_unload_entry(
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.components.select.common import MockSelectEntity
|
||||
from .common import MockSelectEntity
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -21,6 +21,8 @@ from homeassistant.helpers.entity_registry import RegistryEntryHider
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util.json import load_json
|
||||
|
||||
from .common import UNITS_OF_MEASUREMENT, MockSensor
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
async_get_device_automation_capabilities,
|
||||
@ -28,7 +30,6 @@ from tests.common import (
|
||||
async_mock_service,
|
||||
setup_test_component_platform,
|
||||
)
|
||||
from tests.components.sensor.common import UNITS_OF_MEASUREMENT, MockSensor
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
|
||||
|
@ -24,6 +24,8 @@ from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.util.json import load_json
|
||||
|
||||
from .common import UNITS_OF_MEASUREMENT, MockSensor
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
async_fire_time_changed,
|
||||
@ -32,7 +34,6 @@ from tests.common import (
|
||||
async_mock_service,
|
||||
setup_test_component_platform,
|
||||
)
|
||||
from tests.components.sensor.common import UNITS_OF_MEASUREMENT, MockSensor
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
|
||||
|
@ -51,6 +51,8 @@ from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util import dt as dt_util
|
||||
from homeassistant.util.unit_system import METRIC_SYSTEM, US_CUSTOMARY_SYSTEM
|
||||
|
||||
from .common import MockRestoreSensor, MockSensor
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
MockEntityPlatform,
|
||||
@ -65,7 +67,6 @@ from tests.common import (
|
||||
mock_restore_cache_with_extra_data,
|
||||
setup_test_component_platform,
|
||||
)
|
||||
from tests.components.sensor.common import MockRestoreSensor, MockSensor
|
||||
|
||||
TEST_DOMAIN = "test"
|
||||
|
||||
|
@ -41,6 +41,8 @@ from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.util.unit_system import METRIC_SYSTEM, US_CUSTOMARY_SYSTEM
|
||||
|
||||
from .common import MockSensor
|
||||
|
||||
from tests.common import setup_test_component_platform
|
||||
from tests.components.recorder.common import (
|
||||
assert_dict_of_states_equal_without_context_and_last_changed,
|
||||
@ -50,7 +52,6 @@ from tests.components.recorder.common import (
|
||||
do_adhoc_statistics,
|
||||
statistics_during_period,
|
||||
)
|
||||
from tests.components.sensor.common import MockSensor
|
||||
from tests.typing import RecorderInstanceGenerator, WebSocketGenerator
|
||||
|
||||
BATTERY_SENSOR_ATTRIBUTES = {
|
||||
|
@ -7,9 +7,10 @@ from syrupy import SnapshotAssertion
|
||||
from homeassistant.components.seventeentrack import DOMAIN, SERVICE_GET_PACKAGES
|
||||
from homeassistant.core import HomeAssistant, SupportsResponse
|
||||
|
||||
from . import init_integration
|
||||
from .conftest import get_package
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.seventeentrack import init_integration
|
||||
from tests.components.seventeentrack.conftest import get_package
|
||||
|
||||
|
||||
async def test_get_packages_from_list(
|
||||
|
@ -8,8 +8,9 @@ from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from . import setup_integration
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.streamlabswater import setup_integration
|
||||
|
||||
|
||||
async def test_all_entities(
|
||||
|
@ -8,8 +8,9 @@ from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from . import setup_integration
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.streamlabswater import setup_integration
|
||||
|
||||
|
||||
async def test_all_entities(
|
||||
|
@ -20,12 +20,13 @@ from homeassistant.core import HomeAssistant, ServiceCall, State
|
||||
from homeassistant.helpers.restore_state import STORAGE_KEY as RESTORE_STATE_KEY
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .common import MockRestoreText, MockTextEntity
|
||||
|
||||
from tests.common import (
|
||||
async_mock_restore_state_shutdown_restart,
|
||||
mock_restore_cache_with_extra_data,
|
||||
setup_test_component_platform,
|
||||
)
|
||||
from tests.components.text.common import MockRestoreText, MockTextEntity
|
||||
|
||||
|
||||
async def test_text_default(hass: HomeAssistant) -> None:
|
||||
|
@ -12,8 +12,9 @@ from homeassistant.const import (
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .common import MockTimeEntity
|
||||
|
||||
from tests.common import setup_test_component_platform
|
||||
from tests.components.time.common import MockTimeEntity
|
||||
|
||||
|
||||
async def test_date(hass: HomeAssistant) -> None:
|
||||
|
@ -4,8 +4,9 @@ from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from .conftest import ComponentSetup
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.trend.conftest import ComponentSetup
|
||||
|
||||
|
||||
async def test_setup_and_remove_config_entry(
|
||||
|
@ -16,9 +16,9 @@ from homeassistant.data_entry_flow import FlowResult, FlowResultType
|
||||
from homeassistant.helpers import config_entry_oauth2_flow
|
||||
|
||||
from . import get_generator, setup_integration
|
||||
from .conftest import CLIENT_ID, TITLE
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.twitch.conftest import CLIENT_ID, TITLE
|
||||
from tests.typing import ClientSessionGenerator
|
||||
|
||||
|
||||
|
@ -14,6 +14,8 @@ from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from .common import MockUpdateEntity
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
async_fire_time_changed,
|
||||
@ -22,7 +24,6 @@ from tests.common import (
|
||||
async_mock_service,
|
||||
setup_test_component_platform,
|
||||
)
|
||||
from tests.components.update.common import MockUpdateEntity
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
|
||||
|
@ -17,9 +17,10 @@ from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
from .common import MockUpdateEntity
|
||||
|
||||
from tests.common import async_fire_time_changed, setup_test_component_platform
|
||||
from tests.components.recorder.common import async_wait_recording_done
|
||||
from tests.components.update.common import MockUpdateEntity
|
||||
|
||||
|
||||
async def test_exclude_attributes(
|
||||
|
@ -16,8 +16,7 @@ from homeassistant.components.withings.const import DOMAIN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import MockConfigEntry, load_json_array_fixture
|
||||
from tests.components.withings import (
|
||||
from . import (
|
||||
load_activity_fixture,
|
||||
load_goals_fixture,
|
||||
load_measurements_fixture,
|
||||
@ -25,6 +24,8 @@ from tests.components.withings import (
|
||||
load_workout_fixture,
|
||||
)
|
||||
|
||||
from tests.common import MockConfigEntry, load_json_array_fixture
|
||||
|
||||
CLIENT_ID = "1234"
|
||||
CLIENT_SECRET = "5678"
|
||||
SCOPES = [
|
||||
|
@ -9,10 +9,9 @@ from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import load_workout_fixture
|
||||
from . import load_workout_fixture, setup_integration
|
||||
|
||||
from tests.common import MockConfigEntry, async_fire_time_changed
|
||||
from tests.components.withings import setup_integration
|
||||
from tests.typing import ClientSessionGenerator
|
||||
|
||||
|
||||
|
@ -7,9 +7,10 @@ from syrupy import SnapshotAssertion
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import prepare_webhook_setup, setup_integration
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||
from tests.components.withings import prepare_webhook_setup, setup_integration
|
||||
from tests.typing import ClientSessionGenerator
|
||||
|
||||
|
||||
|
@ -15,8 +15,9 @@ from homeassistant.components.youtube.const import DOMAIN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from . import MockYouTube
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.youtube import MockYouTube
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
|
||||
type ComponentSetup = Callable[[], Awaitable[MockYouTube]]
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
from homeassistant.components.zha.core.cluster_handlers import parse_and_log_command
|
||||
|
||||
from tests.components.zha.test_cluster_handlers import ( # noqa: F401
|
||||
from .test_cluster_handlers import ( # noqa: F401
|
||||
endpoint,
|
||||
poll_control_ch,
|
||||
zigpy_coordinator_device,
|
||||
|
Loading…
x
Reference in New Issue
Block a user