Bump zwave-js-server-python to 0.51.0 (#99250)
* Bump zwave-js-server-python to 0.51.0 * Fix how we patch the command
This commit is contained in:
parent
cdf39ec365
commit
be126da72d
5 changed files with 19 additions and 20 deletions
|
@ -3298,22 +3298,21 @@ async def test_subscribe_log_updates(
|
|||
}
|
||||
|
||||
# Test FailedZWaveCommand is caught
|
||||
with patch(
|
||||
"zwave_js_server.model.driver.Driver.async_start_listening_logs",
|
||||
side_effect=FailedZWaveCommand("failed_command", 1, "error message"),
|
||||
):
|
||||
await ws_client.send_json(
|
||||
{
|
||||
ID: 2,
|
||||
TYPE: "zwave_js/subscribe_log_updates",
|
||||
ENTRY_ID: entry.entry_id,
|
||||
}
|
||||
)
|
||||
msg = await ws_client.receive_json()
|
||||
client.async_start_listening_logs.side_effect = FailedZWaveCommand(
|
||||
"failed_command", 1, "error message"
|
||||
)
|
||||
await ws_client.send_json(
|
||||
{
|
||||
ID: 2,
|
||||
TYPE: "zwave_js/subscribe_log_updates",
|
||||
ENTRY_ID: entry.entry_id,
|
||||
}
|
||||
)
|
||||
msg = await ws_client.receive_json()
|
||||
|
||||
assert not msg["success"]
|
||||
assert msg["error"]["code"] == "zwave_error"
|
||||
assert msg["error"]["message"] == "Z-Wave error 1: error message"
|
||||
assert not msg["success"]
|
||||
assert msg["error"]["code"] == "zwave_error"
|
||||
assert msg["error"]["message"] == "Z-Wave error 1: error message"
|
||||
|
||||
# Test sending command with not loaded entry fails
|
||||
await hass.config_entries.async_unload(entry.entry_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue