Apply hass-relative-import to tests (d-h) (#78730)
This commit is contained in:
parent
aa0cbf0afe
commit
a809e18559
34 changed files with 64 additions and 51 deletions
|
@ -7,8 +7,9 @@ from homeassistant import config_entries, data_entry_flow
|
|||
from homeassistant.components.dexcom.const import DOMAIN, MG_DL, MMOL_L
|
||||
from homeassistant.const import CONF_UNIT_OF_MEASUREMENT, CONF_USERNAME
|
||||
|
||||
from . import CONFIG
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.dexcom import CONFIG
|
||||
|
||||
|
||||
async def test_form(hass):
|
||||
|
|
|
@ -6,8 +6,9 @@ from pydexcom import AccountError, SessionError
|
|||
from homeassistant.components.dexcom.const import DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
|
||||
from . import CONFIG, init_integration
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.dexcom import CONFIG, init_integration
|
||||
|
||||
|
||||
async def test_setup_entry_account_error(hass):
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.helpers.entity_component import async_update_entity
|
||||
|
||||
from tests.components.dexcom import GLUCOSE_READING, init_integration
|
||||
from . import GLUCOSE_READING, init_integration
|
||||
|
||||
|
||||
async def test_sensors(hass):
|
||||
|
|
|
@ -11,7 +11,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.components.directv import (
|
||||
from . import (
|
||||
HOST,
|
||||
MOCK_SSDP_DISCOVERY_INFO,
|
||||
MOCK_USER_INPUT,
|
||||
|
@ -20,6 +20,7 @@ from tests.components.directv import (
|
|||
mock_connection,
|
||||
setup_integration,
|
||||
)
|
||||
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ from homeassistant.components.directv.const import DOMAIN
|
|||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from tests.components.directv import setup_integration
|
||||
from . import setup_integration
|
||||
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
|
||||
# pylint: disable=redefined-outer-name
|
||||
|
|
|
@ -58,7 +58,8 @@ from homeassistant.core import HomeAssistant
|
|||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
from tests.components.directv import setup_integration
|
||||
from . import setup_integration
|
||||
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
|
||||
ATTR_UNIQUE_ID = "unique_id"
|
||||
|
|
|
@ -10,7 +10,8 @@ from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_O
|
|||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from tests.components.directv import setup_integration
|
||||
from . import setup_integration
|
||||
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
|
||||
ATTR_UNIQUE_ID = "unique_id"
|
||||
|
|
|
@ -11,8 +11,9 @@ from httpx import Response
|
|||
import pytest
|
||||
import respx
|
||||
|
||||
from . import MOCK_PANEL_ID, MOCK_PANEL_PIN
|
||||
|
||||
from tests.common import load_fixture
|
||||
from tests.components.elmax import MOCK_PANEL_ID, MOCK_PANEL_PIN
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
|
|
@ -14,8 +14,7 @@ from homeassistant.components.elmax.const import (
|
|||
)
|
||||
from homeassistant.config_entries import SOURCE_REAUTH
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.elmax import (
|
||||
from . import (
|
||||
MOCK_PANEL_ID,
|
||||
MOCK_PANEL_NAME,
|
||||
MOCK_PANEL_PIN,
|
||||
|
@ -23,6 +22,8 @@ from tests.components.elmax import (
|
|||
MOCK_USERNAME,
|
||||
)
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
CONF_POLLING = "polling"
|
||||
|
||||
|
||||
|
|
|
@ -9,8 +9,9 @@ import pytest
|
|||
|
||||
from homeassistant.components.freedompro.const import DOMAIN
|
||||
|
||||
from .const import DEVICES, DEVICES_STATE
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.freedompro.const import DEVICES, DEVICES_STATE
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
|
|
@ -8,8 +8,9 @@ from homeassistant.const import STATE_OFF, STATE_ON
|
|||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .conftest import get_states_response_for_uid
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.freedompro.conftest import get_states_response_for_uid
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
@ -20,8 +20,9 @@ from homeassistant.const import ATTR_ENTITY_ID
|
|||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .conftest import get_states_response_for_uid
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.freedompro.conftest import get_states_response_for_uid
|
||||
|
||||
uid = "3WRRJR6RCZQZSND8VP0YTO3YXCSOFPKBMW8T51TU-LQ*TWMYQKL3UVED4HSIIB9GXJWJZBQCXG-9VE-N2IUAIWI"
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from homeassistant.components.freedompro.const import DOMAIN
|
|||
from homeassistant.config_entries import SOURCE_USER
|
||||
from homeassistant.const import CONF_API_KEY
|
||||
|
||||
from tests.components.freedompro.const import DEVICES
|
||||
from .const import DEVICES
|
||||
|
||||
VALID_CONFIG = {
|
||||
CONF_API_KEY: "ksdjfgslkjdfksjdfksjgfksjd",
|
||||
|
|
|
@ -17,8 +17,9 @@ from homeassistant.helpers import device_registry as dr, entity_registry as er
|
|||
from homeassistant.helpers.entity_component import async_update_entity
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .conftest import get_states_response_for_uid
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.freedompro.conftest import get_states_response_for_uid
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
@ -13,8 +13,9 @@ from homeassistant.helpers import device_registry as dr, entity_registry as er
|
|||
from homeassistant.helpers.entity_component import async_update_entity
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .conftest import get_states_response_for_uid
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.freedompro.conftest import get_states_response_for_uid
|
||||
|
||||
uid = "3WRRJR6RCZQZSND8VP0YTO3YXCSOFPKBMW8T51TU-LQ*ILYH1E3DWZOVMNEUIMDYMNLOW-LFRQFDPWWJOVHVDOS"
|
||||
|
||||
|
|
|
@ -12,8 +12,9 @@ from homeassistant.helpers import device_registry as dr, entity_registry as er
|
|||
from homeassistant.helpers.entity_component import async_update_entity
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .conftest import get_states_response_for_uid
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.freedompro.conftest import get_states_response_for_uid
|
||||
|
||||
uid = "2WRRJR6RCZQZSND8VP0YTO3YXCSOFPKBMW8T51TU-LQ*2VAS3HTWINNZ5N6HVEIPDJ6NX85P2-AM-GSYWUCNPU0"
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@ import pytest
|
|||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .conftest import get_states_response_for_uid
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.freedompro.conftest import get_states_response_for_uid
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
@ -8,8 +8,9 @@ from homeassistant.helpers import entity_registry as er
|
|||
from homeassistant.helpers.entity_component import async_update_entity
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .conftest import get_states_response_for_uid
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.freedompro.conftest import get_states_response_for_uid
|
||||
|
||||
uid = "3WRRJR6RCZQZSND8VP0YTO3YXCSOFPKBMW8T51TU-LQ*1JKU1MVWHQL-Z9SCUS85VFXMRGNDCDNDDUVVDKBU31W"
|
||||
|
||||
|
|
|
@ -36,8 +36,9 @@ from homeassistant.setup import async_setup_component
|
|||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.util.unit_system import IMPERIAL_SYSTEM
|
||||
|
||||
from . import _generate_mock_feed_entry
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.gdacs import _generate_mock_feed_entry
|
||||
|
||||
CONFIG = {gdacs.DOMAIN: {CONF_RADIUS: 200}}
|
||||
|
||||
|
|
|
@ -22,8 +22,9 @@ from homeassistant.const import (
|
|||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from . import _generate_mock_feed_entry
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.gdacs import _generate_mock_feed_entry
|
||||
|
||||
CONFIG = {gdacs.DOMAIN: {CONF_RADIUS: 200}}
|
||||
|
||||
|
|
|
@ -30,8 +30,9 @@ from homeassistant.setup import async_setup_component
|
|||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.util.unit_system import IMPERIAL_SYSTEM
|
||||
|
||||
from . import _generate_mock_feed_entry
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.geonetnz_quakes import _generate_mock_feed_entry
|
||||
|
||||
CONFIG = {geonetnz_quakes.DOMAIN: {CONF_RADIUS: 200}}
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@ from homeassistant.const import (
|
|||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from . import _generate_mock_feed_entry
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.geonetnz_quakes import _generate_mock_feed_entry
|
||||
|
||||
CONFIG = {geonetnz_quakes.DOMAIN: {CONF_RADIUS: 200}}
|
||||
|
||||
|
|
|
@ -25,8 +25,9 @@ from homeassistant.setup import async_setup_component
|
|||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.util.unit_system import IMPERIAL_SYSTEM
|
||||
|
||||
from . import _generate_mock_feed_entry
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.geonetnz_volcano import _generate_mock_feed_entry
|
||||
|
||||
CONFIG = {geonetnz_volcano.DOMAIN: {CONF_RADIUS: 200}}
|
||||
|
||||
|
|
|
@ -9,8 +9,9 @@ from homeassistant.components.gios import config_flow
|
|||
from homeassistant.components.gios.const import CONF_STATION_ID
|
||||
from homeassistant.const import CONF_NAME
|
||||
|
||||
from . import STATIONS
|
||||
|
||||
from tests.common import load_fixture
|
||||
from tests.components.gios import STATIONS
|
||||
|
||||
CONFIG = {
|
||||
CONF_NAME: "Foo",
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
"""Test GIOS diagnostics."""
|
||||
import json
|
||||
|
||||
from . import init_integration
|
||||
|
||||
from tests.common import load_fixture
|
||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||
from tests.components.gios import init_integration
|
||||
|
||||
|
||||
async def test_entry_diagnostics(hass, hass_client):
|
||||
|
|
|
@ -8,10 +8,9 @@ from homeassistant.config_entries import ConfigEntryState
|
|||
from homeassistant.const import STATE_UNAVAILABLE
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from . import STATIONS
|
||||
from . import STATIONS, init_integration
|
||||
|
||||
from tests.common import MockConfigEntry, load_fixture, mock_device_registry
|
||||
from tests.components.gios import init_integration
|
||||
|
||||
|
||||
async def test_async_setup_entry(hass):
|
||||
|
|
|
@ -28,8 +28,9 @@ from homeassistant.const import (
|
|||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from . import init_integration
|
||||
|
||||
from tests.common import async_fire_time_changed, load_fixture
|
||||
from tests.components.gios import init_integration
|
||||
|
||||
|
||||
async def test_sensor(hass):
|
||||
|
|
|
@ -27,7 +27,7 @@ from homeassistant.const import (
|
|||
CONF_UNIT_SYSTEM_IMPERIAL,
|
||||
)
|
||||
|
||||
from tests.components.google_travel_time.const import MOCK_CONFIG
|
||||
from .const import MOCK_CONFIG
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("validate_config_entry", "bypass_setup")
|
||||
|
|
|
@ -26,8 +26,9 @@ from homeassistant.helpers import entity_registry as er
|
|||
from homeassistant.helpers.event import TRACK_STATE_CHANGE_CALLBACKS
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from . import common
|
||||
|
||||
from tests.common import MockConfigEntry, assert_setup_component
|
||||
from tests.components.group import common
|
||||
|
||||
|
||||
async def test_setup_group_with_mixed_groupable_states(hass):
|
||||
|
|
|
@ -12,12 +12,9 @@ from homeassistant.components.home_plus_control.const import (
|
|||
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
|
||||
from homeassistant.helpers import config_entry_oauth2_flow
|
||||
|
||||
from .conftest import CLIENT_ID, CLIENT_SECRET, SUBSCRIPTION_KEY
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.home_plus_control.conftest import (
|
||||
CLIENT_ID,
|
||||
CLIENT_SECRET,
|
||||
SUBSCRIPTION_KEY,
|
||||
)
|
||||
|
||||
|
||||
async def test_full_flow(
|
||||
|
|
|
@ -8,11 +8,7 @@ from homeassistant.components.home_plus_control.const import (
|
|||
)
|
||||
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
|
||||
|
||||
from tests.components.home_plus_control.conftest import (
|
||||
CLIENT_ID,
|
||||
CLIENT_SECRET,
|
||||
SUBSCRIPTION_KEY,
|
||||
)
|
||||
from .conftest import CLIENT_ID, CLIENT_SECRET, SUBSCRIPTION_KEY
|
||||
|
||||
|
||||
async def test_loading(hass, mock_config_entry):
|
||||
|
|
|
@ -18,12 +18,9 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
|
||||
from .conftest import CLIENT_ID, CLIENT_SECRET, SUBSCRIPTION_KEY
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
from tests.components.home_plus_control.conftest import (
|
||||
CLIENT_ID,
|
||||
CLIENT_SECRET,
|
||||
SUBSCRIPTION_KEY,
|
||||
)
|
||||
|
||||
|
||||
def entity_assertions(
|
||||
|
|
|
@ -9,8 +9,9 @@ from homeassistant.const import CONF_ID, CONF_PASSWORD, CONF_USERNAME, STATE_UNA
|
|||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .test_data import MOCK_CURRENT_MEASUREMENTS
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.huisbaasje.test_data import MOCK_CURRENT_MEASUREMENTS
|
||||
|
||||
|
||||
async def test_setup(hass: HomeAssistant):
|
||||
|
|
|
@ -21,11 +21,9 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .test_data import MOCK_CURRENT_MEASUREMENTS, MOCK_LIMITED_CURRENT_MEASUREMENTS
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.huisbaasje.test_data import (
|
||||
MOCK_CURRENT_MEASUREMENTS,
|
||||
MOCK_LIMITED_CURRENT_MEASUREMENTS,
|
||||
)
|
||||
|
||||
|
||||
async def test_setup_entry(hass: HomeAssistant):
|
||||
|
|
Loading…
Add table
Reference in a new issue