mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 23:41:48 -05:00
Fix tests for hassio network after_dependency and global adapter mock
This commit is contained in:
@@ -18,6 +18,7 @@ from homeassistant.components.network.const import (
|
||||
STORAGE_KEY,
|
||||
STORAGE_VERSION,
|
||||
)
|
||||
from homeassistant.components.network.network import async_get_loaded_network
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import issue_registry as ir
|
||||
@@ -742,7 +743,8 @@ async def test_async_reload_adapters(hass: HomeAssistant) -> None:
|
||||
):
|
||||
await network.async_reload_adapters(hass)
|
||||
assert len(signals) == 1
|
||||
assert network.async_get_loaded_adapters(hass) == changed
|
||||
# Read the singleton directly; async_get_loaded_adapters is globally mocked.
|
||||
assert async_get_loaded_network(hass).adapters == changed
|
||||
|
||||
|
||||
async def test_async_get_announce_addresses(hass: HomeAssistant) -> None:
|
||||
|
||||
@@ -586,8 +586,8 @@ async def test_discovery_requirements_mqtt(hass: HomeAssistant) -> None:
|
||||
) as mock_process:
|
||||
await async_get_integration_with_requirements(hass, "mqtt_comp")
|
||||
|
||||
assert len(mock_process.mock_calls) == 2
|
||||
# one for mqtt and one for hassio
|
||||
assert len(mock_process.mock_calls) == 3
|
||||
# one for mqtt, one for hassio, and one for network (hassio after_dependency)
|
||||
assert mock_process.mock_calls[0][1][1] == mqtt.requirements
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user