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:
parent
31ef034c3f
commit
80207835d7
5 changed files with 80 additions and 40 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue