Migrate homekit to use async_at_started (#113102)

This commit is contained in:
J. Nick Koston 2024-03-11 14:08:02 -10:00 committed by GitHub
parent 5dc44500c3
commit 6e59d1cb29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 112 additions and 103 deletions

View file

@ -1,6 +1,6 @@
"""Test HomeKit initialization."""
from unittest.mock import patch
from unittest.mock import AsyncMock, Mock, patch
import pytest
@ -31,7 +31,9 @@ async def test_humanify_homekit_changed_event(
) -> None:
"""Test humanifying HomeKit changed event."""
hass.config.components.add("recorder")
with patch("homeassistant.components.homekit.HomeKit"):
with patch("homeassistant.components.homekit.HomeKit") as mock_homekit:
mock_homekit.return_value = homekit = Mock()
type(homekit).async_start = AsyncMock()
assert await async_setup_component(hass, "homekit", {"homekit": {}})
assert await async_setup_component(hass, "logbook", {})
await hass.async_block_till_done()