Improve zwave_js test coverage (#83372)

* Improve zwave_js test coverage

* review comments and clean up test
This commit is contained in:
Raman Gupta 2022-12-06 14:18:21 -05:00 committed by GitHub
parent dc3401c94e
commit 8d1a70391e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 119 additions and 12 deletions

View file

@ -87,6 +87,26 @@ def get_device(hass, node):
return dev_reg.async_get_device({device_id})
async def test_no_driver(
hass, client, multisensor_6, controller_state, integration, hass_ws_client
):
"""Test driver missing results in error."""
entry = integration
ws_client = await hass_ws_client(hass)
client.driver = None
# Try API call with entry ID
await ws_client.send_json(
{
ID: 1,
TYPE: "zwave_js/network_status",
ENTRY_ID: entry.entry_id,
}
)
msg = await ws_client.receive_json()
assert not msg["success"]
async def test_network_status(
hass, multisensor_6, controller_state, integration, hass_ws_client
):