mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
Move core fundamental components into bootstrap (#105560)
Co-authored-by: Erik <erik@montnemery.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
@@ -87,12 +87,21 @@ async def test_async_enable_logging(
|
||||
|
||||
|
||||
async def test_load_hassio(hass: HomeAssistant) -> None:
|
||||
"""Test that we load Hass.io component."""
|
||||
"""Test that we load the hassio integration when using Supervisor."""
|
||||
with patch.dict(os.environ, {}, clear=True):
|
||||
assert bootstrap._get_domains(hass, {}) == set()
|
||||
assert "hassio" not in bootstrap._get_domains(hass, {})
|
||||
|
||||
with patch.dict(os.environ, {"SUPERVISOR": "1"}):
|
||||
assert bootstrap._get_domains(hass, {}) == {"hassio"}
|
||||
assert "hassio" in bootstrap._get_domains(hass, {})
|
||||
|
||||
|
||||
async def test_load_backup(hass: HomeAssistant) -> None:
|
||||
"""Test that we load the backup integration when not using Supervisor."""
|
||||
with patch.dict(os.environ, {}, clear=True):
|
||||
assert "backup" in bootstrap._get_domains(hass, {})
|
||||
|
||||
with patch.dict(os.environ, {"SUPERVISOR": "1"}):
|
||||
assert "backup" not in bootstrap._get_domains(hass, {})
|
||||
|
||||
|
||||
@pytest.mark.parametrize("load_registries", [False])
|
||||
@@ -784,6 +793,7 @@ async def test_setup_recovery_mode_if_no_frontend(
|
||||
|
||||
|
||||
@pytest.mark.parametrize("load_registries", [False])
|
||||
@patch("homeassistant.bootstrap.DEFAULT_INTEGRATIONS", set())
|
||||
async def test_empty_integrations_list_is_only_sent_at_the_end_of_bootstrap(
|
||||
hass: HomeAssistant,
|
||||
) -> None:
|
||||
@@ -836,7 +846,7 @@ async def test_empty_integrations_list_is_only_sent_at_the_end_of_bootstrap(
|
||||
|
||||
assert integrations[0] != {}
|
||||
assert "an_after_dep" in integrations[0]
|
||||
assert integrations[-3] != {}
|
||||
assert integrations[-2] != {}
|
||||
assert integrations[-1] == {}
|
||||
|
||||
assert "normal_integration" in hass.config.components
|
||||
|
||||
Reference in New Issue
Block a user