mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add tests for component configuration with multiple errors (#103964)
* Add tests for component configuration with multiple errors * Add new configuration file * Fix typo --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
@@ -121,7 +121,9 @@ async def mock_non_adr_0007_integration(hass) -> None:
|
||||
configuration key
|
||||
"""
|
||||
|
||||
test_platform_schema = IOT_DOMAIN_PLATFORM_SCHEMA.extend({"option1": str})
|
||||
test_platform_schema = IOT_DOMAIN_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required("option1"): str, vol.Optional("option2"): str}
|
||||
)
|
||||
mock_platform(
|
||||
hass,
|
||||
"non_adr_0007.iot_domain",
|
||||
@@ -133,7 +135,13 @@ async def mock_non_adr_0007_integration(hass) -> None:
|
||||
async def mock_adr_0007_integrations(hass) -> list[Integration]:
|
||||
"""Mock ADR-0007 compliant integrations."""
|
||||
integrations = []
|
||||
for domain in ["adr_0007_1", "adr_0007_2", "adr_0007_3", "adr_0007_4"]:
|
||||
for domain in [
|
||||
"adr_0007_1",
|
||||
"adr_0007_2",
|
||||
"adr_0007_3",
|
||||
"adr_0007_4",
|
||||
"adr_0007_5",
|
||||
]:
|
||||
adr_0007_config_schema = vol.Schema(
|
||||
{
|
||||
domain: vol.Schema(
|
||||
@@ -1504,6 +1512,7 @@ async def test_component_config_validation_error(
|
||||
"adr_0007_2",
|
||||
"adr_0007_3",
|
||||
"adr_0007_4",
|
||||
"adr_0007_5",
|
||||
]:
|
||||
integration = await async_get_integration(hass, domain)
|
||||
await config_util.async_process_component_config(
|
||||
|
||||
Reference in New Issue
Block a user