Alexa typing part 5 (smart_home) (#97918)
* smart_home * Fix test_disabled * Remove unused type ignore
This commit is contained in:
parent
1ee0c907b0
commit
0614702f98
3 changed files with 48 additions and 35 deletions
|
@ -2798,20 +2798,13 @@ async def test_disabled(hass: HomeAssistant) -> None:
|
|||
hass.states.async_set("switch.test", "on", {"friendly_name": "Test switch"})
|
||||
request = get_new_request("Alexa.PowerController", "TurnOn", "switch#test")
|
||||
|
||||
call_switch = async_mock_service(hass, "switch", "turn_on")
|
||||
async_mock_service(hass, "switch", "turn_on")
|
||||
|
||||
msg = await smart_home.async_handle_message(
|
||||
hass, get_default_config(hass), request, enabled=False
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert "event" in msg
|
||||
msg = msg["event"]
|
||||
|
||||
assert not call_switch
|
||||
assert msg["header"]["name"] == "ErrorResponse"
|
||||
assert msg["header"]["namespace"] == "Alexa"
|
||||
assert msg["payload"]["type"] == "BRIDGE_UNREACHABLE"
|
||||
with pytest.raises(AssertionError):
|
||||
await smart_home.async_handle_message(
|
||||
hass, get_default_config(hass), request, enabled=False
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
async def test_endpoint_good_health(hass: HomeAssistant) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue