1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Adjust REST schema validation (#81723)

fixes undefined
This commit is contained in:
epenet
2022-11-08 11:18:58 +01:00
committed by GitHub
parent 53c1c2eb56
commit c585817e67
2 changed files with 27 additions and 2 deletions

View File

@@ -19,7 +19,11 @@ from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from homeassistant.util.dt import utcnow
from tests.common import async_fire_time_changed, get_fixture_path
from tests.common import (
assert_setup_component,
async_fire_time_changed,
get_fixture_path,
)
@respx.mock
@@ -400,3 +404,17 @@ async def test_multiple_rest_endpoints(hass: HomeAssistant) -> None:
assert hass.states.get("sensor.json_date_time").state == "07:11:08 PM"
assert hass.states.get("sensor.json_time").state == "07:11:39 PM"
assert hass.states.get("binary_sensor.binary_sensor").state == "on"
async def test_empty_config(hass: HomeAssistant) -> None:
"""Test setup with empty configuration.
For example (with rest.yaml an empty file):
rest: !include rest.yaml
"""
assert await async_setup_component(
hass,
DOMAIN,
{DOMAIN: {}},
)
assert_setup_component(0, DOMAIN)