Ensure entity platform in light tests (#135787)

This commit is contained in:
G Johansson 2025-01-16 23:26:50 +01:00 committed by GitHub
parent 619917c679
commit 88c3be4ecf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2626,7 +2626,9 @@ def test_filter_supported_color_modes() -> None:
assert light.filter_supported_color_modes(supported) == {light.ColorMode.BRIGHTNESS}
def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) -> None:
def test_deprecated_supported_features_ints(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None:
"""Test deprecated supported features ints."""
class MockLightEntityEntity(light.LightEntity):
@ -2636,6 +2638,8 @@ def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) ->
return 1
entity = MockLightEntityEntity()
entity.hass = hass
entity.platform = MockEntityPlatform(hass, domain="test", platform_name="test")
assert entity.supported_features_compat is light.LightEntityFeature(1)
assert "MockLightEntityEntity" in caplog.text
assert "is using deprecated supported features values" in caplog.text