Move imports to top for mochad (#29514)

* Move imports to top for mochad

* Fix test test_light.py for mochad

* Fix test test_switch.py for mochad

* Make intra package imports relative in switch and light
This commit is contained in:
springstan 2019-12-06 02:02:34 +01:00 committed by Martin Hjelmare
parent 9ba9b3339b
commit 3b6bc9067f
5 changed files with 35 additions and 34 deletions

View file

@ -14,8 +14,8 @@ from tests.common import get_test_home_assistant
@pytest.fixture(autouse=True)
def pymochad_mock():
"""Mock pymochad."""
with mock.patch.dict("sys.modules", {"pymochad": mock.MagicMock()}):
yield
with mock.patch("homeassistant.components.mochad.light.device") as device:
yield device
class TestMochadSwitchSetup(unittest.TestCase):