Deprecate deprecated switch constants (#106225)
This commit is contained in:
parent
06220849fc
commit
4d5bea7bcc
2 changed files with 28 additions and 3 deletions
|
@ -9,7 +9,7 @@ from homeassistant.setup import async_setup_component
|
|||
|
||||
from . import common
|
||||
|
||||
from tests.common import MockUser
|
||||
from tests.common import MockUser, import_and_test_deprecated_constant_enum
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
@ -80,3 +80,14 @@ async def test_switch_context(
|
|||
assert state2 is not None
|
||||
assert state.state != state2.state
|
||||
assert state2.context.user_id == hass_admin_user.id
|
||||
|
||||
|
||||
@pytest.mark.parametrize(("enum"), list(switch.SwitchDeviceClass))
|
||||
def test_deprecated_constants(
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
enum: switch.SwitchDeviceClass,
|
||||
) -> None:
|
||||
"""Test deprecated constants."""
|
||||
import_and_test_deprecated_constant_enum(
|
||||
caplog, switch, enum, "DEVICE_CLASS_", "2025.1"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue