Fix hassio mocking in ESPHome dashboard tests (#143212)

This commit is contained in:
J. Nick Koston
2025-04-18 02:11:36 -10:00
committed by GitHub
parent 221a8597da
commit 9b1ab34352
3 changed files with 67 additions and 55 deletions

View File

@@ -81,6 +81,7 @@ async def test_restore_dashboard_storage_end_to_end(
assert mock_dashboard_api.mock_calls[0][1][0] == "http://new-host:6052"
@pytest.mark.usefixtures("hassio_stubs")
async def test_restore_dashboard_storage_skipped_if_addon_uninstalled(
hass: HomeAssistant,
hass_storage: dict[str, Any],
@@ -105,9 +106,7 @@ async def test_restore_dashboard_storage_skipped_if_addon_uninstalled(
return_value={},
),
):
await async_setup_component(hass, "hassio", {})
await hass.async_block_till_done()
await async_setup_component(hass, DOMAIN, {})
assert await async_setup_component(hass, DOMAIN, {})
await hass.async_block_till_done()
assert "test-slug is no longer installed" in caplog.text
assert not mock_dashboard_api.called