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:
Erik Montnemery
2023-11-14 15:08:20 +01:00
committed by GitHub
parent 2d39eaf0a2
commit 381ebf3e53
12 changed files with 111 additions and 10 deletions

View File

@@ -10,6 +10,14 @@ iot_domain:
# This violates the non_adr_0007.iot_domain platform schema (no_such_option does not exist)
- platform: non_adr_0007
no_such_option: abc
option1: abc
# This violates the non_adr_0007.iot_domain platform schema:
# - no_such_option does not exist
# - option1 is missing
# - option2 is wrong type
- platform: non_adr_0007
no_such_option: abc
option2: 123
# This is correct and should not generate errors
adr_0007_1:
@@ -27,3 +35,11 @@ adr_0007_3:
adr_0007_4:
host: blah.com
no_such_option: foo
# Multiple errors:
# - host is missing
# - no_such_option does not exist
# - port is wrong type
adr_0007_5:
no_such_option: foo
port: foo

View File

@@ -2,3 +2,5 @@ iot_domain: !include integrations/iot_domain.yaml
adr_0007_1: !include integrations/adr_0007_1.yaml
adr_0007_2: !include integrations/adr_0007_2.yaml
adr_0007_3: !include integrations/adr_0007_3.yaml
adr_0007_4: !include integrations/adr_0007_4.yaml
adr_0007_5: !include integrations/adr_0007_5.yaml

View File

@@ -0,0 +1,6 @@
# Multiple errors:
# - host is missing
# - no_such_option does not exist
# - port is wrong type
no_such_option: foo
port: foo

View File

@@ -9,3 +9,11 @@
# This violates the non_adr_0007.iot_domain platform schema (no_such_option does not exist)
- platform: non_adr_0007
no_such_option: abc
option1: abc
# This violates the non_adr_0007.iot_domain platform schema:
# - no_such_option does not exist
# - option1 is missing
# - option2 is wrong type
- platform: non_adr_0007
no_such_option: abc
option2: 123

View File

@@ -1,3 +1,4 @@
# This violates the non_adr_0007.iot_domain platform schema (no_such_option does not exist)
platform: non_adr_0007
no_such_option: abc
option1: abc

View File

@@ -0,0 +1,7 @@
# This violates the non_adr_0007.iot_domain platform schema:
# - no_such_option does not exist
# - option1 is missing
# - option2 is wrong type
platform: non_adr_0007
no_such_option: abc
option2: 123

View File

@@ -4,3 +4,11 @@
# This violates the non_adr_0007.iot_domain platform schema (no_such_option does not exist)
- platform: non_adr_0007
no_such_option: abc
option1: abc
# This violates the non_adr_0007.iot_domain platform schema:
# - no_such_option does not exist
# - option1 is missing
# - option2 is wrong type
- platform: non_adr_0007
no_such_option: abc
option2: 123

View File

@@ -19,6 +19,16 @@ homeassistant:
# This violates the non_adr_0007.iot_domain platform schema (no_such_option does not exist)
- platform: non_adr_0007
no_such_option: abc
option1: abc
pack_iot_domain_5:
iot_domain:
# This violates the non_adr_0007.iot_domain platform schema:
# - no_such_option does not exist
# - option1 is missing
# - option2 is wrong type
- platform: non_adr_0007
no_such_option: abc
option2: 123
pack_adr_0007_1:
# This is correct and should not generate errors
adr_0007_1:
@@ -36,3 +46,11 @@ homeassistant:
adr_0007_4:
host: blah.com
no_such_option: foo
pack_adr_0007_5:
# Multiple errors:
# - host is missing
# - no_such_option does not exist
# - port is wrong type
adr_0007_5:
no_such_option: foo
port: foo

View File

@@ -0,0 +1,7 @@
# Multiple errors:
# - host is missing
# - no_such_option does not exist
# - port is wrong type
adr_0007_5:
no_such_option: foo
port: foo

View File

@@ -9,4 +9,12 @@ iot_domain:
option1: 123
# This violates the non_adr_0007.iot_domain platform schema (no_such_option does not exist)
- platform: non_adr_0007
- no_such_option: abc
no_such_option: abc
option1: abc
# This violates the non_adr_0007.iot_domain platform schema:
# - no_such_option does not exist
# - option1 is missing
# - option2 is wrong type
- platform: non_adr_0007
no_such_option: abc
option2: 123