mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Ensure entity platform in alert tests (#135714)
This commit is contained in:
parent
566f514a75
commit
0f8785d8bc
@ -30,7 +30,7 @@ from homeassistant.const import (
|
|||||||
from homeassistant.core import HomeAssistant, ServiceCall
|
from homeassistant.core import HomeAssistant, ServiceCall
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from tests.common import async_mock_service
|
from tests.common import MockEntityPlatform, async_mock_service
|
||||||
|
|
||||||
NAME = "alert_test"
|
NAME = "alert_test"
|
||||||
DONE_MESSAGE = "alert_gone"
|
DONE_MESSAGE = "alert_gone"
|
||||||
@ -338,6 +338,7 @@ async def test_skipfirst(hass: HomeAssistant, mock_notifier: list[ServiceCall])
|
|||||||
async def test_done_message_state_tracker_reset_on_cancel(hass: HomeAssistant) -> None:
|
async def test_done_message_state_tracker_reset_on_cancel(hass: HomeAssistant) -> None:
|
||||||
"""Test that the done message is reset when canceled."""
|
"""Test that the done message is reset when canceled."""
|
||||||
entity = alert.AlertEntity(hass, *TEST_NOACK)
|
entity = alert.AlertEntity(hass, *TEST_NOACK)
|
||||||
|
entity.platform = MockEntityPlatform(hass)
|
||||||
entity._cancel = lambda *args: None
|
entity._cancel = lambda *args: None
|
||||||
assert entity._send_done_message is False
|
assert entity._send_done_message is False
|
||||||
entity._send_done_message = True
|
entity._send_done_message = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user