mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Clean up zwave_js test_removed_device test (#107346)
This commit is contained in:
parent
cd8adfc84e
commit
d19037a36b
@ -964,22 +964,14 @@ async def test_removed_device(
|
|||||||
device_entries = dr.async_entries_for_config_entry(dev_reg, integration.entry_id)
|
device_entries = dr.async_entries_for_config_entry(dev_reg, integration.entry_id)
|
||||||
assert len(device_entries) == 3
|
assert len(device_entries) == 3
|
||||||
|
|
||||||
# Check how many entities there are
|
|
||||||
ent_reg = er.async_get(hass)
|
|
||||||
entity_entries = er.async_entries_for_config_entry(ent_reg, integration.entry_id)
|
|
||||||
assert len(entity_entries) == 93
|
|
||||||
|
|
||||||
# Remove a node and reload the entry
|
# Remove a node and reload the entry
|
||||||
old_node = driver.controller.nodes.pop(13)
|
old_node = driver.controller.nodes.pop(13)
|
||||||
await hass.config_entries.async_reload(integration.entry_id)
|
await hass.config_entries.async_reload(integration.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# Assert that the node and all of it's entities were removed from the device and
|
# Assert that the node was removed from the device registry
|
||||||
# entity registry
|
|
||||||
device_entries = dr.async_entries_for_config_entry(dev_reg, integration.entry_id)
|
device_entries = dr.async_entries_for_config_entry(dev_reg, integration.entry_id)
|
||||||
assert len(device_entries) == 2
|
assert len(device_entries) == 2
|
||||||
entity_entries = er.async_entries_for_config_entry(ent_reg, integration.entry_id)
|
|
||||||
assert len(entity_entries) == 62
|
|
||||||
assert (
|
assert (
|
||||||
dev_reg.async_get_device(identifiers={get_device_id(driver, old_node)}) is None
|
dev_reg.async_get_device(identifiers={get_device_id(driver, old_node)}) is None
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user