From e9f55f4e54f07b09dce223fed77b45cb17373a50 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 19 Sep 2022 09:51:31 +0200 Subject: [PATCH] Apply hass-relative-import to tests (s-z) (#78733) --- tests/components/signal_messenger/test_notify.py | 2 +- tests/components/sleepiq/test_binary_sensor.py | 2 +- tests/components/sleepiq/test_button.py | 7 +------ tests/components/sleepiq/test_config_flow.py | 2 +- tests/components/sleepiq/test_init.py | 5 +++-- tests/components/sleepiq/test_light.py | 8 ++------ tests/components/sleepiq/test_number.py | 2 +- tests/components/sleepiq/test_select.py | 2 +- tests/components/sleepiq/test_sensor.py | 2 +- tests/components/sleepiq/test_switch.py | 8 ++------ tests/components/sonarr/test_config_flow.py | 3 ++- tests/components/speedtestdotnet/conftest.py | 2 +- tests/components/srp_energy/test_init.py | 2 +- tests/components/stream/test_hls.py | 5 +++-- tests/components/stream/test_ll_hls.py | 7 +------ tests/components/stream/test_worker.py | 5 +++-- tests/components/subaru/test_sensor.py | 7 +------ tests/components/switch/test_init.py | 2 +- tests/components/switch/test_light.py | 3 ++- tests/components/tcp/test_binary_sensor.py | 3 ++- tests/components/twinkly/test_init.py | 8 ++------ tests/components/twinkly/test_light.py | 3 ++- tests/components/velbus/conftest.py | 3 ++- tests/components/wallbox/test_config_flow.py | 2 +- tests/components/wallbox/test_init.py | 5 ++--- tests/components/wallbox/test_lock.py | 4 ++-- tests/components/wallbox/test_number.py | 4 ++-- tests/components/wallbox/test_sensor.py | 4 ++-- tests/components/wallbox/test_switch.py | 4 ++-- tests/components/whirlpool/test_init.py | 2 +- tests/components/wilight/test_config_flow.py | 5 +++-- tests/components/wilight/test_init.py | 2 +- tests/components/wilight/test_light.py | 2 +- tests/components/withings/test_common.py | 7 ++----- tests/components/xiaomi_miio/test_select.py | 3 ++- tests/components/zha/conftest.py | 3 ++- tests/components/zha/test_fan.py | 3 +-- tests/components/zha/test_light.py | 2 +- tests/components/zha/test_switch.py | 2 +- 39 files changed, 63 insertions(+), 84 deletions(-) diff --git a/tests/components/signal_messenger/test_notify.py b/tests/components/signal_messenger/test_notify.py index 6ed57813f46..cc233e88c03 100644 --- a/tests/components/signal_messenger/test_notify.py +++ b/tests/components/signal_messenger/test_notify.py @@ -14,7 +14,7 @@ import voluptuous as vol from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component -from tests.components.signal_messenger.conftest import ( +from .conftest import ( CONTENT, MESSAGE, NUMBER_FROM, diff --git a/tests/components/sleepiq/test_binary_sensor.py b/tests/components/sleepiq/test_binary_sensor.py index bce30ad2393..7f12b9ea44a 100644 --- a/tests/components/sleepiq/test_binary_sensor.py +++ b/tests/components/sleepiq/test_binary_sensor.py @@ -9,7 +9,7 @@ from homeassistant.const import ( ) from homeassistant.helpers import entity_registry as er -from tests.components.sleepiq.conftest import ( +from .conftest import ( BED_NAME, BED_NAME_LOWER, SLEEPER_L_ID, diff --git a/tests/components/sleepiq/test_button.py b/tests/components/sleepiq/test_button.py index cab3f36d73f..1c148dc8850 100644 --- a/tests/components/sleepiq/test_button.py +++ b/tests/components/sleepiq/test_button.py @@ -3,12 +3,7 @@ from homeassistant.components.button import DOMAIN from homeassistant.const import ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME from homeassistant.helpers import entity_registry as er -from tests.components.sleepiq.conftest import ( - BED_ID, - BED_NAME, - BED_NAME_LOWER, - setup_platform, -) +from .conftest import BED_ID, BED_NAME, BED_NAME_LOWER, setup_platform async def test_button_calibrate(hass, mock_asyncsleepiq): diff --git a/tests/components/sleepiq/test_config_flow.py b/tests/components/sleepiq/test_config_flow.py index 75a2524e2bc..3e944ec69f8 100644 --- a/tests/components/sleepiq/test_config_flow.py +++ b/tests/components/sleepiq/test_config_flow.py @@ -9,7 +9,7 @@ from homeassistant.components.sleepiq.const import DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from homeassistant.core import HomeAssistant -from tests.components.sleepiq.conftest import SLEEPIQ_CONFIG, setup_platform +from .conftest import SLEEPIQ_CONFIG, setup_platform async def test_import(hass: HomeAssistant) -> None: diff --git a/tests/components/sleepiq/test_init.py b/tests/components/sleepiq/test_init.py index e468734e063..6a02f795805 100644 --- a/tests/components/sleepiq/test_init.py +++ b/tests/components/sleepiq/test_init.py @@ -19,8 +19,7 @@ from homeassistant.helpers import entity_registry as er from homeassistant.setup import async_setup_component from homeassistant.util.dt import utcnow -from tests.common import MockConfigEntry, async_fire_time_changed, mock_registry -from tests.components.sleepiq.conftest import ( +from .conftest import ( BED_ID, SLEEPER_L_ID, SLEEPER_L_NAME, @@ -29,6 +28,8 @@ from tests.components.sleepiq.conftest import ( setup_platform, ) +from tests.common import MockConfigEntry, async_fire_time_changed, mock_registry + ENTITY_IS_IN_BED = f"sensor.sleepnumber_{BED_ID}_{SLEEPER_L_NAME_LOWER}_{IS_IN_BED}" ENTITY_PRESSURE = f"sensor.sleepnumber_{BED_ID}_{SLEEPER_L_NAME_LOWER}_{PRESSURE}" ENTITY_SLEEP_NUMBER = ( diff --git a/tests/components/sleepiq/test_light.py b/tests/components/sleepiq/test_light.py index d7386cceb7b..6003dd82e30 100644 --- a/tests/components/sleepiq/test_light.py +++ b/tests/components/sleepiq/test_light.py @@ -5,13 +5,9 @@ from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON from homeassistant.helpers import entity_registry as er from homeassistant.util.dt import utcnow +from .conftest import BED_ID, BED_NAME, BED_NAME_LOWER, setup_platform + from tests.common import async_fire_time_changed -from tests.components.sleepiq.conftest import ( - BED_ID, - BED_NAME, - BED_NAME_LOWER, - setup_platform, -) async def test_setup(hass, mock_asyncsleepiq): diff --git a/tests/components/sleepiq/test_number.py b/tests/components/sleepiq/test_number.py index bf554b69499..903bf054ac7 100644 --- a/tests/components/sleepiq/test_number.py +++ b/tests/components/sleepiq/test_number.py @@ -10,7 +10,7 @@ from homeassistant.components.number.const import ( from homeassistant.const import ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, ATTR_ICON from homeassistant.helpers import entity_registry as er -from tests.components.sleepiq.conftest import ( +from .conftest import ( BED_ID, BED_NAME, BED_NAME_LOWER, diff --git a/tests/components/sleepiq/test_select.py b/tests/components/sleepiq/test_select.py index 855ca518f2d..d0e2a0e828d 100644 --- a/tests/components/sleepiq/test_select.py +++ b/tests/components/sleepiq/test_select.py @@ -11,7 +11,7 @@ from homeassistant.const import ( from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er -from tests.components.sleepiq.conftest import ( +from .conftest import ( BED_ID, BED_NAME, BED_NAME_LOWER, diff --git a/tests/components/sleepiq/test_sensor.py b/tests/components/sleepiq/test_sensor.py index 68ee5319db6..b74f78dbc88 100644 --- a/tests/components/sleepiq/test_sensor.py +++ b/tests/components/sleepiq/test_sensor.py @@ -3,7 +3,7 @@ from homeassistant.components.sensor import DOMAIN from homeassistant.const import ATTR_FRIENDLY_NAME, ATTR_ICON from homeassistant.helpers import entity_registry as er -from tests.components.sleepiq.conftest import ( +from .conftest import ( BED_NAME, BED_NAME_LOWER, SLEEPER_L_ID, diff --git a/tests/components/sleepiq/test_switch.py b/tests/components/sleepiq/test_switch.py index 38fc747c39d..7e48b51fbea 100644 --- a/tests/components/sleepiq/test_switch.py +++ b/tests/components/sleepiq/test_switch.py @@ -5,13 +5,9 @@ from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON from homeassistant.helpers import entity_registry as er from homeassistant.util.dt import utcnow +from .conftest import BED_ID, BED_NAME, BED_NAME_LOWER, setup_platform + from tests.common import async_fire_time_changed -from tests.components.sleepiq.conftest import ( - BED_ID, - BED_NAME, - BED_NAME_LOWER, - setup_platform, -) async def test_setup(hass, mock_asyncsleepiq): diff --git a/tests/components/sonarr/test_config_flow.py b/tests/components/sonarr/test_config_flow.py index 5eea0974dee..bf2694d7a24 100644 --- a/tests/components/sonarr/test_config_flow.py +++ b/tests/components/sonarr/test_config_flow.py @@ -15,8 +15,9 @@ from homeassistant.const import CONF_API_KEY, CONF_SOURCE, CONF_URL, CONF_VERIFY from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType +from . import MOCK_REAUTH_INPUT, MOCK_USER_INPUT + from tests.common import MockConfigEntry -from tests.components.sonarr import MOCK_REAUTH_INPUT, MOCK_USER_INPUT async def test_show_user_form(hass: HomeAssistant) -> None: diff --git a/tests/components/speedtestdotnet/conftest.py b/tests/components/speedtestdotnet/conftest.py index 78a864cb934..3324b92d8bd 100644 --- a/tests/components/speedtestdotnet/conftest.py +++ b/tests/components/speedtestdotnet/conftest.py @@ -3,7 +3,7 @@ from unittest.mock import patch import pytest -from tests.components.speedtestdotnet import MOCK_RESULTS, MOCK_SERVERS +from . import MOCK_RESULTS, MOCK_SERVERS @pytest.fixture(autouse=True) diff --git a/tests/components/srp_energy/test_init.py b/tests/components/srp_energy/test_init.py index 8c8d87674fe..1806fc7d5c4 100644 --- a/tests/components/srp_energy/test_init.py +++ b/tests/components/srp_energy/test_init.py @@ -2,7 +2,7 @@ from homeassistant import config_entries from homeassistant.components import srp_energy -from tests.components.srp_energy import init_integration +from . import init_integration async def test_setup_entry(hass): diff --git a/tests/components/stream/test_hls.py b/tests/components/stream/test_hls.py index ad430cb6e49..204b460b026 100644 --- a/tests/components/stream/test_hls.py +++ b/tests/components/stream/test_hls.py @@ -20,13 +20,14 @@ from homeassistant.components.stream.core import Part from homeassistant.setup import async_setup_component import homeassistant.util.dt as dt_util -from tests.common import async_fire_time_changed -from tests.components.stream.common import ( +from .common import ( FAKE_TIME, DefaultSegment as Segment, assert_mp4_has_transform_matrix, ) +from tests.common import async_fire_time_changed + STREAM_SOURCE = "some-stream-source" INIT_BYTES = b"init" FAKE_PAYLOAD = b"fake-payload" diff --git a/tests/components/stream/test_ll_hls.py b/tests/components/stream/test_ll_hls.py index 447b9ff58e9..5755617f393 100644 --- a/tests/components/stream/test_ll_hls.py +++ b/tests/components/stream/test_ll_hls.py @@ -22,14 +22,9 @@ from homeassistant.components.stream.const import ( from homeassistant.components.stream.core import Part from homeassistant.setup import async_setup_component +from .common import FAKE_TIME, DefaultSegment as Segment, generate_h264_video from .test_hls import STREAM_SOURCE, HlsClient, make_playlist -from tests.components.stream.common import ( - FAKE_TIME, - DefaultSegment as Segment, - generate_h264_video, -) - SEGMENT_DURATION = 6 TEST_PART_DURATION = 0.75 NUM_PART_SEGMENTS = int(-(-SEGMENT_DURATION // TEST_PART_DURATION)) diff --git a/tests/components/stream/test_worker.py b/tests/components/stream/test_worker.py index 70769840dd7..00d735df74d 100644 --- a/tests/components/stream/test_worker.py +++ b/tests/components/stream/test_worker.py @@ -48,9 +48,10 @@ from homeassistant.components.stream.worker import ( ) from homeassistant.setup import async_setup_component +from .common import generate_h264_video, generate_h265_video +from .test_ll_hls import TEST_PART_DURATION + from tests.components.camera.common import EMPTY_8_6_JPEG, mock_turbo_jpeg -from tests.components.stream.common import generate_h264_video, generate_h265_video -from tests.components.stream.test_ll_hls import TEST_PART_DURATION STREAM_SOURCE = "some-stream-source" # Formats here are arbitrary, not exercised by tests diff --git a/tests/components/subaru/test_sensor.py b/tests/components/subaru/test_sensor.py index f2a66e7e5e9..6ad5e729290 100644 --- a/tests/components/subaru/test_sensor.py +++ b/tests/components/subaru/test_sensor.py @@ -20,12 +20,7 @@ from .api_responses import ( VEHICLE_DATA, VEHICLE_STATUS_EV, ) - -from tests.components.subaru.conftest import ( - MOCK_API_FETCH, - MOCK_API_GET_DATA, - advance_time_to_next_fetch, -) +from .conftest import MOCK_API_FETCH, MOCK_API_GET_DATA, advance_time_to_next_fetch VEHICLE_NAME = VEHICLE_DATA[TEST_VIN_2_EV][VEHICLE_NAME] diff --git a/tests/components/switch/test_init.py b/tests/components/switch/test_init.py index ed3d3c59da9..29f77b0d470 100644 --- a/tests/components/switch/test_init.py +++ b/tests/components/switch/test_init.py @@ -6,7 +6,7 @@ from homeassistant.components import switch from homeassistant.const import CONF_PLATFORM from homeassistant.setup import async_setup_component -from tests.components.switch import common +from . import common @pytest.fixture(autouse=True) diff --git a/tests/components/switch/test_light.py b/tests/components/switch/test_light.py index f3d5cac9238..3d96ed8745c 100644 --- a/tests/components/switch/test_light.py +++ b/tests/components/switch/test_light.py @@ -6,8 +6,9 @@ from homeassistant.components.light import ( ) from homeassistant.setup import async_setup_component +from . import common as switch_common + from tests.components.light import common -from tests.components.switch import common as switch_common async def test_default_state(hass): diff --git a/tests/components/tcp/test_binary_sensor.py b/tests/components/tcp/test_binary_sensor.py index f8c13b41c30..9f1c25a3d49 100644 --- a/tests/components/tcp/test_binary_sensor.py +++ b/tests/components/tcp/test_binary_sensor.py @@ -8,8 +8,9 @@ from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.setup import async_setup_component from homeassistant.util.dt import utcnow +from . import test_sensor as test_tcp + from tests.common import assert_setup_component, async_fire_time_changed -import tests.components.tcp.test_sensor as test_tcp BINARY_SENSOR_CONFIG = test_tcp.TEST_CONFIG["sensor"] TEST_CONFIG = {"binary_sensor": BINARY_SENSOR_CONFIG} diff --git a/tests/components/twinkly/test_init.py b/tests/components/twinkly/test_init.py index b6b86bb7b33..8cf026b4fb8 100644 --- a/tests/components/twinkly/test_init.py +++ b/tests/components/twinkly/test_init.py @@ -13,13 +13,9 @@ from homeassistant.config_entries import ConfigEntryState from homeassistant.const import CONF_MODEL from homeassistant.core import HomeAssistant +from . import TEST_HOST, TEST_MODEL, TEST_NAME_ORIGINAL, ClientMock + from tests.common import MockConfigEntry -from tests.components.twinkly import ( - TEST_HOST, - TEST_MODEL, - TEST_NAME_ORIGINAL, - ClientMock, -) async def test_load_unload_entry(hass: HomeAssistant): diff --git a/tests/components/twinkly/test_light.py b/tests/components/twinkly/test_light.py index 14bed7df007..40fea31a6ba 100644 --- a/tests/components/twinkly/test_light.py +++ b/tests/components/twinkly/test_light.py @@ -16,8 +16,9 @@ from homeassistant.helpers import device_registry as dr, entity_registry as er from homeassistant.helpers.device_registry import DeviceEntry from homeassistant.helpers.entity_registry import RegistryEntry +from . import TEST_MODEL, TEST_NAME_ORIGINAL, ClientMock + from tests.common import MockConfigEntry -from tests.components.twinkly import TEST_MODEL, TEST_NAME_ORIGINAL, ClientMock async def test_initial_state(hass: HomeAssistant): diff --git a/tests/components/velbus/conftest.py b/tests/components/velbus/conftest.py index c13ce3127fa..62aa0d0b505 100644 --- a/tests/components/velbus/conftest.py +++ b/tests/components/velbus/conftest.py @@ -8,8 +8,9 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_NAME, CONF_PORT from homeassistant.core import HomeAssistant +from .const import PORT_TCP + from tests.common import MockConfigEntry -from tests.components.velbus.const import PORT_TCP @pytest.fixture(name="controller") diff --git a/tests/components/wallbox/test_config_flow.py b/tests/components/wallbox/test_config_flow.py index c9254f77aac..bd9e51adda7 100644 --- a/tests/components/wallbox/test_config_flow.py +++ b/tests/components/wallbox/test_config_flow.py @@ -18,7 +18,7 @@ from homeassistant.components.wallbox.const import ( ) from homeassistant.core import HomeAssistant -from tests.components.wallbox import ( +from . import ( authorisation_response, authorisation_response_unauthorised, entry, diff --git a/tests/components/wallbox/test_init.py b/tests/components/wallbox/test_init.py index 5080bab87ea..a0db03b6c43 100644 --- a/tests/components/wallbox/test_init.py +++ b/tests/components/wallbox/test_init.py @@ -7,15 +7,14 @@ from homeassistant.components.wallbox import CHARGER_MAX_CHARGING_CURRENT_KEY from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant -from . import test_response - -from tests.components.wallbox import ( +from . import ( DOMAIN, authorisation_response, entry, setup_integration, setup_integration_connection_error, setup_integration_read_only, + test_response, ) diff --git a/tests/components/wallbox/test_lock.py b/tests/components/wallbox/test_lock.py index fbcb07b0e90..567d92757cd 100644 --- a/tests/components/wallbox/test_lock.py +++ b/tests/components/wallbox/test_lock.py @@ -9,13 +9,13 @@ from homeassistant.components.wallbox import CHARGER_LOCKED_UNLOCKED_KEY from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import HomeAssistant -from tests.components.wallbox import ( +from . import ( authorisation_response, entry, setup_integration, setup_integration_read_only, ) -from tests.components.wallbox.const import MOCK_LOCK_ENTITY_ID +from .const import MOCK_LOCK_ENTITY_ID async def test_wallbox_lock_class(hass: HomeAssistant) -> None: diff --git a/tests/components/wallbox/test_number.py b/tests/components/wallbox/test_number.py index c8e8b29f28b..58e3450e6aa 100644 --- a/tests/components/wallbox/test_number.py +++ b/tests/components/wallbox/test_number.py @@ -9,8 +9,8 @@ from homeassistant.components.wallbox import CHARGER_MAX_CHARGING_CURRENT_KEY from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import HomeAssistant -from tests.components.wallbox import authorisation_response, entry, setup_integration -from tests.components.wallbox.const import MOCK_NUMBER_ENTITY_ID +from . import authorisation_response, entry, setup_integration +from .const import MOCK_NUMBER_ENTITY_ID async def test_wallbox_number_class(hass: HomeAssistant) -> None: diff --git a/tests/components/wallbox/test_sensor.py b/tests/components/wallbox/test_sensor.py index 7663e518d81..a224085f65b 100644 --- a/tests/components/wallbox/test_sensor.py +++ b/tests/components/wallbox/test_sensor.py @@ -2,8 +2,8 @@ from homeassistant.const import CONF_ICON, CONF_UNIT_OF_MEASUREMENT, POWER_KILO_WATT from homeassistant.core import HomeAssistant -from tests.components.wallbox import entry, setup_integration -from tests.components.wallbox.const import ( +from . import entry, setup_integration +from .const import ( MOCK_SENSOR_CHARGING_POWER_ID, MOCK_SENSOR_CHARGING_SPEED_ID, MOCK_SENSOR_MAX_AVAILABLE_POWER, diff --git a/tests/components/wallbox/test_switch.py b/tests/components/wallbox/test_switch.py index c57fee0353f..588eea04513 100644 --- a/tests/components/wallbox/test_switch.py +++ b/tests/components/wallbox/test_switch.py @@ -10,8 +10,8 @@ from homeassistant.components.wallbox.const import CHARGER_STATUS_ID_KEY from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import HomeAssistant -from tests.components.wallbox import authorisation_response, entry, setup_integration -from tests.components.wallbox.const import MOCK_SWITCH_ENTITY_ID +from . import authorisation_response, entry, setup_integration +from .const import MOCK_SWITCH_ENTITY_ID async def test_wallbox_switch_class(hass: HomeAssistant) -> None: diff --git a/tests/components/whirlpool/test_init.py b/tests/components/whirlpool/test_init.py index 626c127b61a..619c2c783b7 100644 --- a/tests/components/whirlpool/test_init.py +++ b/tests/components/whirlpool/test_init.py @@ -7,7 +7,7 @@ from homeassistant.components.whirlpool.const import DOMAIN from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant -from tests.components.whirlpool import init_integration +from . import init_integration async def test_setup(hass: HomeAssistant): diff --git a/tests/components/wilight/test_config_flow.py b/tests/components/wilight/test_config_flow.py index a209d55ba99..a46af6e7d82 100644 --- a/tests/components/wilight/test_config_flow.py +++ b/tests/components/wilight/test_config_flow.py @@ -14,8 +14,7 @@ from homeassistant.const import CONF_HOST, CONF_NAME, CONF_SOURCE from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType -from tests.common import MockConfigEntry -from tests.components.wilight import ( +from . import ( CONF_COMPONENTS, HOST, MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTURER, @@ -26,6 +25,8 @@ from tests.components.wilight import ( WILIGHT_ID, ) +from tests.common import MockConfigEntry + @pytest.fixture(name="dummy_get_components_from_model_clear") def mock_dummy_get_components_from_model_clear(): diff --git a/tests/components/wilight/test_init.py b/tests/components/wilight/test_init.py index 5aadce3caea..860fd8ea54d 100644 --- a/tests/components/wilight/test_init.py +++ b/tests/components/wilight/test_init.py @@ -9,7 +9,7 @@ import requests from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant -from tests.components.wilight import ( +from . import ( HOST, UPNP_MAC_ADDRESS, UPNP_MODEL_NAME_P_B, diff --git a/tests/components/wilight/test_light.py b/tests/components/wilight/test_light.py index 2255840d01c..f82d493e70c 100644 --- a/tests/components/wilight/test_light.py +++ b/tests/components/wilight/test_light.py @@ -19,7 +19,7 @@ from homeassistant.const import ( from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er -from tests.components.wilight import ( +from . import ( HOST, UPNP_MAC_ADDRESS, UPNP_MODEL_NAME_COLOR, diff --git a/tests/components/withings/test_common.py b/tests/components/withings/test_common.py index d65b80f256a..3917c894b60 100644 --- a/tests/components/withings/test_common.py +++ b/tests/components/withings/test_common.py @@ -19,12 +19,9 @@ from homeassistant.components.withings.common import ( from homeassistant.core import HomeAssistant from homeassistant.helpers.config_entry_oauth2_flow import AbstractOAuth2Implementation +from .common import ComponentFactory, get_data_manager_by_user_id, new_profile_config + from tests.common import MockConfigEntry -from tests.components.withings.common import ( - ComponentFactory, - get_data_manager_by_user_id, - new_profile_config, -) from tests.test_util.aiohttp import AiohttpClientMocker diff --git a/tests/components/xiaomi_miio/test_select.py b/tests/components/xiaomi_miio/test_select.py index 3fa8a3de291..014aa6fa2cd 100644 --- a/tests/components/xiaomi_miio/test_select.py +++ b/tests/components/xiaomi_miio/test_select.py @@ -32,8 +32,9 @@ from homeassistant.const import ( ) from homeassistant.core import HomeAssistant +from . import TEST_MAC + from tests.common import MockConfigEntry, async_fire_time_changed -from tests.components.xiaomi_miio import TEST_MAC @pytest.fixture(autouse=True) diff --git a/tests/components/zha/conftest.py b/tests/components/zha/conftest.py index 27155e16cc7..a4d29224b74 100644 --- a/tests/components/zha/conftest.py +++ b/tests/components/zha/conftest.py @@ -20,9 +20,10 @@ import homeassistant.components.zha.core.const as zha_const import homeassistant.components.zha.core.device as zha_core_device from homeassistant.setup import async_setup_component +from . import common + from tests.common import MockConfigEntry from tests.components.light.conftest import mock_light_profiles # noqa: F401 -from tests.components.zha import common FIXTURE_GRP_ID = 0x1001 FIXTURE_GRP_NAME = "fixture group" diff --git a/tests/components/zha/test_fan.py b/tests/components/zha/test_fan.py index 9ebc5ae1c79..d635072fbbe 100644 --- a/tests/components/zha/test_fan.py +++ b/tests/components/zha/test_fan.py @@ -39,14 +39,13 @@ from .common import ( async_enable_traffic, async_find_group_entity_id, async_test_rejoin, + async_wait_for_updates, find_entity_id, get_zha_gateway, send_attributes_report, ) from .conftest import SIG_EP_INPUT, SIG_EP_OUTPUT, SIG_EP_PROFILE, SIG_EP_TYPE -from tests.components.zha.common import async_wait_for_updates - IEEE_GROUPABLE_DEVICE = "01:2d:6f:00:0a:90:69:e8" IEEE_GROUPABLE_DEVICE2 = "02:2d:6f:00:0a:90:69:e8" diff --git a/tests/components/zha/test_light.py b/tests/components/zha/test_light.py index f3779c4841e..a9b8c7a14ee 100644 --- a/tests/components/zha/test_light.py +++ b/tests/components/zha/test_light.py @@ -28,6 +28,7 @@ from .common import ( async_find_group_entity_id, async_shift_time, async_test_rejoin, + async_wait_for_updates, find_entity_id, get_zha_gateway, patch_zha_config, @@ -36,7 +37,6 @@ from .common import ( from .conftest import SIG_EP_INPUT, SIG_EP_OUTPUT, SIG_EP_PROFILE, SIG_EP_TYPE from tests.common import async_fire_time_changed -from tests.components.zha.common import async_wait_for_updates IEEE_GROUPABLE_DEVICE = "01:2d:6f:00:0a:90:69:e8" IEEE_GROUPABLE_DEVICE2 = "02:2d:6f:00:0a:90:69:e9" diff --git a/tests/components/zha/test_switch.py b/tests/components/zha/test_switch.py index 0b8fe658c28..11beec83b9f 100644 --- a/tests/components/zha/test_switch.py +++ b/tests/components/zha/test_switch.py @@ -26,6 +26,7 @@ from .common import ( async_enable_traffic, async_find_group_entity_id, async_test_rejoin, + async_wait_for_updates, find_entity_id, get_zha_gateway, send_attributes_report, @@ -33,7 +34,6 @@ from .common import ( from .conftest import SIG_EP_INPUT, SIG_EP_OUTPUT, SIG_EP_TYPE from tests.common import mock_coro -from tests.components.zha.common import async_wait_for_updates ON = 1 OFF = 0