mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 13:30:43 +00:00
Validate slug in addon services (#99232)
* Validate slug in addon services * Move validator into hassio component * Fixes from mypy * Fix test for changes * Adjust fixtures to current supervisor * Fix call counts after fixture adjustment * Increase coverage
This commit is contained in:
@@ -413,3 +413,10 @@ async def test_api_reboot_host(
|
||||
|
||||
assert await handler.async_reboot_host(hass) == {}
|
||||
assert aioclient_mock.call_count == 1
|
||||
|
||||
|
||||
async def test_send_command_invalid_command(hass: HomeAssistant, hassio_stubs) -> None:
|
||||
"""Test send command fails when command is invalid."""
|
||||
hassio: HassIO = hass.data["hassio"]
|
||||
with pytest.raises(HassioAPIError):
|
||||
await hassio.send_command("/test/../bad")
|
||||
|
||||
Reference in New Issue
Block a user