Fix google assistant cloud sync test (#113044)

This commit is contained in:
J. Nick Koston 2024-03-10 22:44:21 -10:00 committed by GitHub
parent 17aa49410b
commit fd8ee6c857
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -341,12 +341,13 @@ async def test_sync_google_on_home_assistant_start(
config = CloudGoogleConfig(
hass, GACTIONS_SCHEMA({}), "mock-user-id", cloud_prefs, hass.data["cloud"]
)
hass.set_state(CoreState.starting)
hass.set_state(CoreState.not_running)
with patch.object(config, "async_sync_entities_all") as mock_sync:
await config.async_initialize()
await hass.async_block_till_done()
assert len(mock_sync.mock_calls) == 0
hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED)
hass.bus.async_fire(EVENT_HOMEASSISTANT_START)
await hass.async_block_till_done()
assert len(mock_sync.mock_calls) == 1