mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Add missing assert to test_async_remove_ignores_in_flight_polling (#94487)
This commit is contained in:
parent
82b9a31ea7
commit
d51982f12f
@ -602,10 +602,16 @@ async def test_async_remove_ignores_in_flight_polling(hass: HomeAssistant) -> No
|
|||||||
ent.async_on_remove(lambda: result.append(1))
|
ent.async_on_remove(lambda: result.append(1))
|
||||||
await platform.async_add_entities([ent])
|
await platform.async_add_entities([ent])
|
||||||
assert hass.states.get("test.test").state == STATE_UNKNOWN
|
assert hass.states.get("test.test").state == STATE_UNKNOWN
|
||||||
|
|
||||||
|
# Remove the entity from the entity registry
|
||||||
await ent.async_remove()
|
await ent.async_remove()
|
||||||
assert len(result) == 1
|
assert len(result) == 1
|
||||||
assert hass.states.get("test.test") is None
|
assert hass.states.get("test.test") is None
|
||||||
|
|
||||||
|
# Simulate an in-flight poll after the entity was removed
|
||||||
ent.async_write_ha_state()
|
ent.async_write_ha_state()
|
||||||
|
assert len(result) == 1
|
||||||
|
assert hass.states.get("test.test") is None
|
||||||
|
|
||||||
|
|
||||||
async def test_set_context(hass: HomeAssistant) -> None:
|
async def test_set_context(hass: HomeAssistant) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user