Skip to content

Commit

Permalink
Fix test_disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouwh committed Aug 8, 2023
1 parent ed0a61b commit 42a7071
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions tests/components/alexa/test_smart_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

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"]
async_mock_service(hass, "switch", "turn_on")

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:
Expand Down

0 comments on commit 42a7071

Please sign in to comment.