2019-02-08 04:07:15 +00:00
|
|
|
"""Test the default_config init."""
|
|
|
|
from unittest.mock import patch
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2019-12-09 16:42:00 +00:00
|
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
|
2019-05-14 03:58:13 +00:00
|
|
|
from tests.common import MockDependency, mock_coro
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
2019-05-29 21:20:06 +00:00
|
|
|
def zeroconf_mock():
|
|
|
|
"""Mock zeroconf."""
|
2019-07-31 19:25:30 +00:00
|
|
|
with MockDependency("zeroconf") as mocked_zeroconf:
|
|
|
|
mocked_zeroconf.Zeroconf.return_value.register_service.return_value = mock_coro(
|
|
|
|
True
|
|
|
|
)
|
2019-05-14 03:58:13 +00:00
|
|
|
yield
|
2019-02-08 04:07:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def netdisco_mock():
|
|
|
|
"""Mock netdisco."""
|
2019-07-31 19:25:30 +00:00
|
|
|
with MockDependency("netdisco", "discovery"):
|
2019-02-08 04:07:15 +00:00
|
|
|
yield
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def recorder_url_mock():
|
|
|
|
"""Mock recorder url."""
|
2019-07-31 19:25:30 +00:00
|
|
|
with patch("homeassistant.components.recorder.DEFAULT_URL", "sqlite://"):
|
2019-02-08 04:07:15 +00:00
|
|
|
yield
|
|
|
|
|
|
|
|
|
|
|
|
async def test_setup(hass):
|
|
|
|
"""Test setup."""
|
2019-07-31 19:25:30 +00:00
|
|
|
assert await async_setup_component(hass, "default_config", {})
|