Move config_per_platform and extract_domain_configs to config.py (#104989)

This commit is contained in:
Erik Montnemery 2023-12-04 12:48:49 +01:00 committed by GitHub
parent 53becaa976
commit 95f7db1970
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 138 additions and 51 deletions

View file

@ -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
)