Remove uncaught exceptions from rflink (#33709)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
bb8bbc9c54
commit
3697ea7b27
2 changed files with 11 additions and 8 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
from voluptuous.error import MultipleInvalid
|
||||
|
||||
from homeassistant.bootstrap import async_setup_component
|
||||
from homeassistant.components.rflink import (
|
||||
CONF_RECONNECT_INTERVAL,
|
||||
|
@ -169,16 +172,17 @@ async def test_send_command_invalid_arguments(hass, monkeypatch):
|
|||
_, _, protocol, _ = await mock_rflink(hass, config, domain, monkeypatch)
|
||||
|
||||
# one argument missing
|
||||
hass.async_create_task(
|
||||
hass.services.async_call(domain, SERVICE_SEND_COMMAND, {"command": "on"})
|
||||
)
|
||||
hass.async_create_task(
|
||||
hass.services.async_call(
|
||||
with pytest.raises(MultipleInvalid):
|
||||
await hass.services.async_call(domain, SERVICE_SEND_COMMAND, {"command": "on"})
|
||||
|
||||
with pytest.raises(MultipleInvalid):
|
||||
await hass.services.async_call(
|
||||
domain, SERVICE_SEND_COMMAND, {"device_id": "newkaku_0000c6c2_1"}
|
||||
)
|
||||
)
|
||||
|
||||
# no arguments
|
||||
hass.async_create_task(hass.services.async_call(domain, SERVICE_SEND_COMMAND, {}))
|
||||
with pytest.raises(MultipleInvalid):
|
||||
await hass.services.async_call(domain, SERVICE_SEND_COMMAND, {})
|
||||
|
||||
await hass.async_block_till_done()
|
||||
assert protocol.send_command_ack.call_args_list == []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue