mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 20:40:18 +00:00
Move DhcpServiceInfo to service_info helpers (#135658)
* Move DhcpServiceInfo to service_info helpers * Fix mypy/pylint
This commit is contained in:
@@ -34,6 +34,7 @@ from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.device_registry as dr
|
||||
from homeassistant.helpers.discovery_flow import DiscoveryKey
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||
from homeassistant.helpers.service_info.dhcp import DhcpServiceInfo
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
@@ -41,6 +42,7 @@ from tests.common import (
|
||||
MockConfigEntry,
|
||||
MockModule,
|
||||
async_fire_time_changed,
|
||||
import_and_test_deprecated_constant,
|
||||
mock_integration,
|
||||
)
|
||||
|
||||
@@ -1353,3 +1355,30 @@ async def test_dhcp_rediscover_no_match(
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert len(mock_init.mock_calls) == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("constant_name", "replacement_name", "replacement"),
|
||||
[
|
||||
(
|
||||
"DhcpServiceInfo",
|
||||
"homeassistant.helpers.service_info.dhcp.DhcpServiceInfo",
|
||||
DhcpServiceInfo,
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_deprecated_constants(
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
constant_name: str,
|
||||
replacement_name: str,
|
||||
replacement: Any,
|
||||
) -> None:
|
||||
"""Test deprecated automation constants."""
|
||||
import_and_test_deprecated_constant(
|
||||
caplog,
|
||||
dhcp,
|
||||
constant_name,
|
||||
replacement_name,
|
||||
replacement,
|
||||
"2026.2",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user