Ensure entity platform in camera tests (#135918)
parent
f5d35bca72
commit
53f80e9759
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue