2019-02-08 04:07:15 +00:00
|
|
|
"""Test the default_config init."""
|
2021-01-01 21:31:56 +00:00
|
|
|
from unittest.mock import patch
|
|
|
|
|
2019-02-08 04:07:15 +00:00
|
|
|
import pytest
|
|
|
|
|
2022-07-22 13:11:34 +00:00
|
|
|
from homeassistant.helpers import recorder as recorder_helper
|
2019-12-09 16:42:00 +00:00
|
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
|
2021-03-02 08:02:04 +00:00
|
|
|
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
|
2020-05-03 18:27:19 +00:00
|
|
|
|
2019-02-08 04:07:15 +00:00
|
|
|
|
2020-07-18 01:17:40 +00:00
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def mock_ssdp():
|
|
|
|
"""Mock ssdp."""
|
2022-10-15 18:00:46 +00:00
|
|
|
with patch("homeassistant.components.ssdp.Scanner.async_scan"), patch(
|
|
|
|
"homeassistant.components.ssdp.Server.async_start"
|
|
|
|
), patch("homeassistant.components.ssdp.Server.async_stop"):
|
2020-07-18 01:17:40 +00:00
|
|
|
yield
|
|
|
|
|
|
|
|
|
2019-02-08 04:07:15 +00:00
|
|
|
@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
|
|
|
|
|
|
|
|
|
2022-07-22 18:19:53 +00:00
|
|
|
async def test_setup(hass, mock_zeroconf, mock_get_source_ip, mock_bluetooth):
|
2019-02-08 04:07:15 +00:00
|
|
|
"""Test setup."""
|
2022-07-22 13:11:34 +00:00
|
|
|
recorder_helper.async_initialize_recorder(hass)
|
2020-04-06 11:36:49 +00:00
|
|
|
assert await async_setup_component(hass, "default_config", {"foo": "bar"})
|