Improve test coverage for zwave_js (#93262)
This commit is contained in:
parent
5bc825a8ab
commit
ec12d9a197
3 changed files with 77 additions and 0 deletions
24
tests/components/zwave_js/test_helpers.py
Normal file
24
tests/components/zwave_js/test_helpers.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
"""Test the Z-Wave JS helpers module."""
|
||||
from homeassistant.components.zwave_js.helpers import (
|
||||
async_get_node_status_sensor_entity_id,
|
||||
async_get_nodes_from_area_id,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import area_registry as ar, device_registry as dr
|
||||
|
||||
|
||||
async def test_async_get_node_status_sensor_entity_id(hass: HomeAssistant) -> None:
|
||||
"""Test async_get_node_status_sensor_entity_id for non zwave_js device."""
|
||||
dev_reg = dr.async_get(hass)
|
||||
device = dev_reg.async_get_or_create(
|
||||
config_entry_id="123",
|
||||
identifiers={("test", "test")},
|
||||
)
|
||||
assert async_get_node_status_sensor_entity_id(hass, device.id) is None
|
||||
|
||||
|
||||
async def test_async_get_nodes_from_area_id(hass: HomeAssistant) -> None:
|
||||
"""Test async_get_nodes_from_area_id."""
|
||||
area_reg = ar.async_get(hass)
|
||||
area = area_reg.async_create("test")
|
||||
assert not async_get_nodes_from_area_id(hass, area.id)
|
Loading…
Add table
Add a link
Reference in a new issue