Skip to content

Commit

Permalink
Update test_init.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Jul 6, 2023
1 parent 2ed3693 commit 8e113e5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/components/script/test_init.py
Expand Up @@ -26,7 +26,7 @@
callback,
split_entity_id,
)
from homeassistant.exceptions import HomeAssistantError, ServiceNotFound
from homeassistant.exceptions import ServiceNotFound
from homeassistant.helpers import entity_registry as er, template
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers.script import (
Expand Down Expand Up @@ -1625,7 +1625,7 @@ async def test_responses(hass: HomeAssistant, response: Any) -> None:
)


async def test_responses_error(hass: HomeAssistant) -> None:
async def test_responses_no_response(hass: HomeAssistant) -> None:
"""Test response variable not set."""
mock_restore_cache(hass, ())
assert await async_setup_component(
Expand All @@ -1645,10 +1645,13 @@ async def test_responses_error(hass: HomeAssistant) -> None:
},
)

with pytest.raises(HomeAssistantError):
assert await hass.services.async_call(
# Validate we can call it with return_response
assert (
await hass.services.async_call(
DOMAIN, "test", {"greeting": "world"}, blocking=True, return_response=True
)
== {}
)
# Validate we can also call it without return_response
assert (
await hass.services.async_call(
Expand Down

0 comments on commit 8e113e5

Please sign in to comment.