parent
6a10e89f6d
commit
77e385db52
|
@ -708,6 +708,9 @@ async def test_invalid_area_floor_names(hass: HomeAssistant) -> None:
|
||||||
)
|
)
|
||||||
intent.async_register(hass, handler)
|
intent.async_register(hass, handler)
|
||||||
|
|
||||||
|
# Need a light to avoid domain error
|
||||||
|
hass.states.async_set("light.test", "off")
|
||||||
|
|
||||||
with pytest.raises(intent.MatchFailedError) as err:
|
with pytest.raises(intent.MatchFailedError) as err:
|
||||||
await intent.async_handle(
|
await intent.async_handle(
|
||||||
hass,
|
hass,
|
||||||
|
@ -715,7 +718,7 @@ async def test_invalid_area_floor_names(hass: HomeAssistant) -> None:
|
||||||
"TestType",
|
"TestType",
|
||||||
slots={"area": {"value": "invalid area"}},
|
slots={"area": {"value": "invalid area"}},
|
||||||
)
|
)
|
||||||
assert err.value.result.no_match_reason == intent.MatchFailedReason.INVALID_AREA
|
assert err.value.result.no_match_reason == intent.MatchFailedReason.INVALID_AREA
|
||||||
|
|
||||||
with pytest.raises(intent.MatchFailedError) as err:
|
with pytest.raises(intent.MatchFailedError) as err:
|
||||||
await intent.async_handle(
|
await intent.async_handle(
|
||||||
|
@ -724,9 +727,7 @@ async def test_invalid_area_floor_names(hass: HomeAssistant) -> None:
|
||||||
"TestType",
|
"TestType",
|
||||||
slots={"floor": {"value": "invalid floor"}},
|
slots={"floor": {"value": "invalid floor"}},
|
||||||
)
|
)
|
||||||
assert (
|
assert err.value.result.no_match_reason == intent.MatchFailedReason.INVALID_FLOOR
|
||||||
err.value.result.no_match_reason == intent.MatchFailedReason.INVALID_FLOOR
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def test_service_intent_handler_required_domains(hass: HomeAssistant) -> None:
|
async def test_service_intent_handler_required_domains(hass: HomeAssistant) -> None:
|
||||||
|
|
Loading…
Reference in New Issue