Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/components/shelly/test_device_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ async def test_rpc_no_runtime_data(
) -> None:
"""Test the device trigger for the RPC device when there is no runtime_data in the entry."""
entry = await init_integration(hass, 2)
# Cache initial runtime_data
runtime_data = entry.runtime_data
monkeypatch.delattr(entry, "runtime_data")
device = dr.async_entries_for_config_entry(device_registry, entry.entry_id)[0]

Expand Down Expand Up @@ -437,6 +439,9 @@ async def test_rpc_no_runtime_data(
assert len(service_calls) == 1
assert service_calls[0].data["some"] == "test_trigger_single_push"

# Restore runtime_data to avoid issues on cleanup
entry.runtime_data = runtime_data
Comment thread
epenet marked this conversation as resolved.


async def test_block_no_runtime_data(
hass: HomeAssistant,
Expand All @@ -447,6 +452,8 @@ async def test_block_no_runtime_data(
) -> None:
"""Test the device trigger for the block device when there is no runtime_data in the entry."""
entry = await init_integration(hass, 1)
# Cache initial runtime_data
runtime_data = entry.runtime_data
monkeypatch.delattr(entry, "runtime_data")
device = dr.async_entries_for_config_entry(device_registry, entry.entry_id)[0]

Expand Down Expand Up @@ -481,3 +488,6 @@ async def test_block_no_runtime_data(

assert len(service_calls) == 1
assert service_calls[0].data["some"] == "test_trigger_single"

# Restore runtime_data to avoid issues on cleanup
entry.runtime_data = runtime_data
Comment thread
epenet marked this conversation as resolved.