mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Remove unused test helper mock_area_registry (#112172)
This commit is contained in:
parent
1b7c3061f3
commit
c58828aac0
@ -2,7 +2,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections import OrderedDict
|
|
||||||
from collections.abc import AsyncGenerator, Generator, Mapping, Sequence
|
from collections.abc import AsyncGenerator, Generator, Mapping, Sequence
|
||||||
from contextlib import asynccontextmanager, contextmanager
|
from contextlib import asynccontextmanager, contextmanager
|
||||||
from datetime import UTC, datetime, timedelta
|
from datetime import UTC, datetime, timedelta
|
||||||
@ -618,27 +617,6 @@ def mock_registry(
|
|||||||
return registry
|
return registry
|
||||||
|
|
||||||
|
|
||||||
def mock_area_registry(
|
|
||||||
hass: HomeAssistant, mock_entries: dict[str, ar.AreaEntry] | None = None
|
|
||||||
) -> ar.AreaRegistry:
|
|
||||||
"""Mock the Area Registry.
|
|
||||||
|
|
||||||
This should only be used if you need to mock/re-stage a clean mocked
|
|
||||||
area registry in your current hass object. It can be useful to,
|
|
||||||
for example, pre-load the registry with items.
|
|
||||||
|
|
||||||
This mock will thus replace the existing registry in the running hass.
|
|
||||||
|
|
||||||
If you just need to access the existing registry, use the `area_registry`
|
|
||||||
fixture instead.
|
|
||||||
"""
|
|
||||||
registry = ar.AreaRegistry(hass)
|
|
||||||
registry.areas = mock_entries or OrderedDict()
|
|
||||||
|
|
||||||
hass.data[ar.DATA_REGISTRY] = registry
|
|
||||||
return registry
|
|
||||||
|
|
||||||
|
|
||||||
def mock_device_registry(
|
def mock_device_registry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_entries: dict[str, dr.DeviceEntry] | None = None,
|
mock_entries: dict[str, dr.DeviceEntry] | None = None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user