mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Ensure entity platform in cover tests (#135917)
This commit is contained in:
parent
53f80e9759
commit
2295e3779a
@ -13,7 +13,11 @@ from homeassistant.setup import async_setup_component
|
|||||||
|
|
||||||
from .common import MockCover
|
from .common import MockCover
|
||||||
|
|
||||||
from tests.common import help_test_all, setup_test_component_platform
|
from tests.common import (
|
||||||
|
MockEntityPlatform,
|
||||||
|
help_test_all,
|
||||||
|
setup_test_component_platform,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def test_services(
|
async def test_services(
|
||||||
@ -157,13 +161,17 @@ def test_all() -> None:
|
|||||||
help_test_all(cover)
|
help_test_all(cover)
|
||||||
|
|
||||||
|
|
||||||
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 MockCoverEntity(cover.CoverEntity):
|
class MockCoverEntity(cover.CoverEntity):
|
||||||
_attr_supported_features = 1
|
_attr_supported_features = 1
|
||||||
|
|
||||||
entity = MockCoverEntity()
|
entity = MockCoverEntity()
|
||||||
|
entity.hass = hass
|
||||||
|
entity.platform = MockEntityPlatform(hass)
|
||||||
assert entity.supported_features is cover.CoverEntityFeature(1)
|
assert entity.supported_features is cover.CoverEntityFeature(1)
|
||||||
assert "MockCoverEntity" in caplog.text
|
assert "MockCoverEntity" 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