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
|
|
|
|
|
2023-02-11 07:26:13 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
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
|
|
|
|
|
2023-05-25 11:45:19 +00:00
|
|
|
|
|
|
|
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
|
|
|
|
def stub_blueprint_populate_autouse(stub_blueprint_populate):
|
|
|
|
"""Stub copying the blueprints to the config folder."""
|
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
|
|
|
|
|
|
|
|
|
2023-02-11 07:26:13 +00:00
|
|
|
async def test_setup(
|
|
|
|
hass: HomeAssistant, mock_zeroconf: None, mock_get_source_ip, mock_bluetooth: None
|
|
|
|
) -> None:
|
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"})
|