Ensure entity platform in camera tests (#135918)

pull/136021/head^2
G Johansson 2025-01-19 21:28:50 +01:00 committed by GitHub
parent f5d35bca72
commit 53f80e9759
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -41,6 +41,7 @@ from homeassistant.util import dt as dt_util
from .common import EMPTY_8_6_JPEG, STREAM_SOURCE, mock_turbo_jpeg
from tests.common import (
MockEntityPlatform,
async_fire_time_changed,
help_test_all,
import_and_test_deprecated_constant_enum,
@ -826,7 +827,9 @@ def test_deprecated_state_constants(
import_and_test_deprecated_constant_enum(caplog, module, enum, "STATE_", "2025.10")
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 MockCamera(camera.Camera):
@ -836,6 +839,8 @@ def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) ->
return 1
entity = MockCamera()
entity.hass = hass
entity.platform = MockEntityPlatform(hass)
assert entity.supported_features_compat is camera.CameraEntityFeature(1)
assert "MockCamera" in caplog.text
assert "is using deprecated supported features values" in caplog.text