mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Ensure entity platform in camera tests (#135918)
This commit is contained in:
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 .common import EMPTY_8_6_JPEG, STREAM_SOURCE, mock_turbo_jpeg
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import (
|
||||||
|
MockEntityPlatform,
|
||||||
async_fire_time_changed,
|
async_fire_time_changed,
|
||||||
help_test_all,
|
help_test_all,
|
||||||
import_and_test_deprecated_constant_enum,
|
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")
|
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."""
|
"""Test deprecated supported features ints."""
|
||||||
|
|
||||||
class MockCamera(camera.Camera):
|
class MockCamera(camera.Camera):
|
||||||
@ -836,6 +839,8 @@ def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) ->
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
entity = MockCamera()
|
entity = MockCamera()
|
||||||
|
entity.hass = hass
|
||||||
|
entity.platform = MockEntityPlatform(hass)
|
||||||
assert entity.supported_features_compat is camera.CameraEntityFeature(1)
|
assert entity.supported_features_compat is camera.CameraEntityFeature(1)
|
||||||
assert "MockCamera" in caplog.text
|
assert "MockCamera" in caplog.text
|
||||||
assert "is using deprecated supported features values" in caplog.text
|
assert "is using deprecated supported features values" in caplog.text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user