mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Move config_per_platform and extract_domain_configs to config.py (#104989)
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant import helpers
|
||||
|
||||
|
||||
def test_extract_domain_configs() -> None:
|
||||
def test_extract_domain_configs(caplog: pytest.LogCaptureFixture) -> None:
|
||||
"""Test the extraction of domain configuration."""
|
||||
config = {
|
||||
"zone": None,
|
||||
@@ -19,8 +21,13 @@ def test_extract_domain_configs() -> None:
|
||||
helpers.extract_domain_configs(config, "zone")
|
||||
)
|
||||
|
||||
assert (
|
||||
"helpers.extract_domain_configs is a deprecated function which will be removed "
|
||||
"in HA Core 2024.6. Use config.extract_domain_configs instead" in caplog.text
|
||||
)
|
||||
|
||||
def test_config_per_platform() -> None:
|
||||
|
||||
def test_config_per_platform(caplog: pytest.LogCaptureFixture) -> None:
|
||||
"""Test config per platform method."""
|
||||
config = OrderedDict(
|
||||
[
|
||||
@@ -36,3 +43,8 @@ def test_config_per_platform() -> None:
|
||||
(None, 1),
|
||||
("hello 2", config["zone Hallo"][1]),
|
||||
] == list(helpers.config_per_platform(config, "zone"))
|
||||
|
||||
assert (
|
||||
"helpers.config_per_platform is a deprecated function which will be removed "
|
||||
"in HA Core 2024.6. Use config.config_per_platform instead" in caplog.text
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user