2019-02-08 04:07:15 +00:00
|
|
|
"""Test the default_config init."""
|
|
|
|
from unittest.mock import patch
|
|
|
|
|
|
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2019-05-14 03:58:13 +00:00
|
|
|
from tests.common import MockDependency, mock_coro
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def aiozeroconf_mock():
|
|
|
|
"""Mock aiozeroconf."""
|
|
|
|
with MockDependency('aiozeroconf') as mocked_zeroconf:
|
|
|
|
mocked_zeroconf.Zeroconf.return_value.register_service \
|
|
|
|
.return_value = mock_coro(True)
|
|
|
|
yield
|
2019-02-08 04:07:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def netdisco_mock():
|
|
|
|
"""Mock netdisco."""
|
|
|
|
with MockDependency('netdisco', 'discovery'):
|
|
|
|
yield
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def recorder_url_mock():
|
|
|
|
"""Mock recorder url."""
|
|
|
|
with patch('homeassistant.components.recorder.DEFAULT_URL', 'sqlite://'):
|
|
|
|
yield
|
|
|
|
|
|
|
|
|
|
|
|
async def test_setup(hass):
|
|
|
|
"""Test setup."""
|
|
|
|
assert await async_setup_component(hass, 'default_config', {})
|