mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Fix homekit test mocking missed in loop changeover (#37628)
This commit is contained in:
parent
4c2b12d8f1
commit
3871688dfb
@ -785,7 +785,7 @@ async def test_homekit_finds_linked_batteries(
|
|||||||
with patch.object(homekit.bridge, "add_accessory"), patch(
|
with patch.object(homekit.bridge, "add_accessory"), patch(
|
||||||
f"{PATH_HOMEKIT}.show_setup_message"
|
f"{PATH_HOMEKIT}.show_setup_message"
|
||||||
), patch(f"{PATH_HOMEKIT}.get_accessory") as mock_get_acc, patch(
|
), patch(f"{PATH_HOMEKIT}.get_accessory") as mock_get_acc, patch(
|
||||||
"pyhap.accessory_driver.AccessoryDriver.start"
|
"pyhap.accessory_driver.AccessoryDriver.start_service"
|
||||||
):
|
):
|
||||||
await homekit.async_start()
|
await homekit.async_start()
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
@ -932,11 +932,15 @@ async def test_homekit_uses_system_zeroconf(hass, hk_driver, mock_zeroconf):
|
|||||||
)
|
)
|
||||||
system_zc = await zeroconf.async_get_instance(hass)
|
system_zc = await zeroconf.async_get_instance(hass)
|
||||||
|
|
||||||
entry.add_to_hass(hass)
|
with patch("pyhap.accessory_driver.AccessoryDriver.start_service"), patch(
|
||||||
assert await hass.config_entries.async_setup(entry.entry_id)
|
f"{PATH_HOMEKIT}.HomeKit.async_stop"
|
||||||
await hass.async_block_till_done()
|
):
|
||||||
assert hass.data[DOMAIN][entry.entry_id][HOMEKIT].driver.advertiser == system_zc
|
entry.add_to_hass(hass)
|
||||||
await hass.async_block_till_done()
|
assert await hass.config_entries.async_setup(entry.entry_id)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
assert hass.data[DOMAIN][entry.entry_id][HOMEKIT].driver.advertiser == system_zc
|
||||||
|
assert await hass.config_entries.async_unload(entry.entry_id)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
||||||
def _write_data(path: str, data: Dict) -> None:
|
def _write_data(path: str, data: Dict) -> None:
|
||||||
@ -1008,7 +1012,7 @@ async def test_homekit_ignored_missing_devices(
|
|||||||
with patch.object(homekit.bridge, "add_accessory"), patch(
|
with patch.object(homekit.bridge, "add_accessory"), patch(
|
||||||
f"{PATH_HOMEKIT}.show_setup_message"
|
f"{PATH_HOMEKIT}.show_setup_message"
|
||||||
), patch(f"{PATH_HOMEKIT}.get_accessory") as mock_get_acc, patch(
|
), patch(f"{PATH_HOMEKIT}.get_accessory") as mock_get_acc, patch(
|
||||||
"pyhap.accessory_driver.AccessoryDriver.start"
|
"pyhap.accessory_driver.AccessoryDriver.start_service"
|
||||||
):
|
):
|
||||||
await homekit.async_start()
|
await homekit.async_start()
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
@ -1082,7 +1086,7 @@ async def test_homekit_finds_linked_motion_sensors(
|
|||||||
with patch.object(homekit.bridge, "add_accessory"), patch(
|
with patch.object(homekit.bridge, "add_accessory"), patch(
|
||||||
f"{PATH_HOMEKIT}.show_setup_message"
|
f"{PATH_HOMEKIT}.show_setup_message"
|
||||||
), patch(f"{PATH_HOMEKIT}.get_accessory") as mock_get_acc, patch(
|
), patch(f"{PATH_HOMEKIT}.get_accessory") as mock_get_acc, patch(
|
||||||
"pyhap.accessory_driver.AccessoryDriver.start"
|
"pyhap.accessory_driver.AccessoryDriver.start_service"
|
||||||
):
|
):
|
||||||
await homekit.async_start()
|
await homekit.async_start()
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
@ -1159,7 +1163,7 @@ async def test_homekit_finds_linked_humidity_sensors(
|
|||||||
with patch.object(homekit.bridge, "add_accessory"), patch(
|
with patch.object(homekit.bridge, "add_accessory"), patch(
|
||||||
f"{PATH_HOMEKIT}.show_setup_message"
|
f"{PATH_HOMEKIT}.show_setup_message"
|
||||||
), patch(f"{PATH_HOMEKIT}.get_accessory") as mock_get_acc, patch(
|
), patch(f"{PATH_HOMEKIT}.get_accessory") as mock_get_acc, patch(
|
||||||
"pyhap.accessory_driver.AccessoryDriver.start"
|
"pyhap.accessory_driver.AccessoryDriver.start_service"
|
||||||
):
|
):
|
||||||
await homekit.async_start()
|
await homekit.async_start()
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user