mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Nicer test imports
unittest changes import path so old style worked but is confusing
This commit is contained in:
parent
14023a15e6
commit
df3ee6005a
@ -9,7 +9,7 @@ import unittest
|
||||
import homeassistant as ha
|
||||
import homeassistant.components.demo as demo
|
||||
|
||||
from common import mock_http_component
|
||||
from tests.common import mock_http_component
|
||||
|
||||
|
||||
class TestDemo(unittest.TestCase):
|
||||
|
@ -14,7 +14,7 @@ from homeassistant.components import (
|
||||
device_tracker, light, sun, device_sun_light_trigger)
|
||||
|
||||
|
||||
from common import (
|
||||
from tests.common import (
|
||||
get_test_home_assistant, ensure_sun_risen, ensure_sun_set,
|
||||
trigger_device_tracker_scan)
|
||||
|
||||
|
@ -18,7 +18,7 @@ from homeassistant.const import (
|
||||
DEVICE_DEFAULT_NAME)
|
||||
import homeassistant.components.device_tracker as device_tracker
|
||||
|
||||
from common import get_test_home_assistant
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
|
||||
def setUpModule(): # pylint: disable=invalid-name
|
||||
|
@ -13,7 +13,7 @@ import homeassistant as ha
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.components import history, recorder
|
||||
|
||||
from common import (
|
||||
from tests.common import (
|
||||
mock_http_component, mock_state_change_event, get_test_home_assistant)
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ from homeassistant.const import (
|
||||
SERVICE_TURN_ON, SERVICE_TURN_OFF)
|
||||
import homeassistant.components.light as light
|
||||
|
||||
from common import mock_service, get_test_home_assistant
|
||||
from tests.common import mock_service, get_test_home_assistant
|
||||
|
||||
|
||||
class TestLight(unittest.TestCase):
|
||||
|
@ -14,7 +14,7 @@ from homeassistant.const import (
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.components import logbook
|
||||
|
||||
from common import get_test_home_assistant, mock_http_component
|
||||
from tests.common import get_test_home_assistant, mock_http_component
|
||||
|
||||
|
||||
class TestComponentHistory(unittest.TestCase):
|
||||
|
@ -15,7 +15,7 @@ from homeassistant.const import (
|
||||
SERVICE_MEDIA_PLAY_PAUSE, SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PAUSE,
|
||||
SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PREVIOUS_TRACK, ATTR_ENTITY_ID)
|
||||
import homeassistant.components.media_player as media_player
|
||||
from common import mock_service
|
||||
from tests.common import mock_service
|
||||
|
||||
|
||||
def setUpModule(): # pylint: disable=invalid-name
|
||||
|
@ -11,7 +11,7 @@ import os
|
||||
from homeassistant.const import MATCH_ALL
|
||||
from homeassistant.components import recorder
|
||||
|
||||
from common import get_test_home_assistant
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
|
||||
class TestRecorder(unittest.TestCase):
|
||||
|
@ -11,7 +11,7 @@ import homeassistant.loader as loader
|
||||
from homeassistant.const import STATE_ON, STATE_OFF, CONF_PLATFORM
|
||||
import homeassistant.components.switch as switch
|
||||
|
||||
from common import get_test_home_assistant
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
|
||||
class TestSwitch(unittest.TestCase):
|
||||
|
Loading…
x
Reference in New Issue
Block a user