Add select selector for blueprints (#45803)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
2744d64a3e
commit
eaa2d371a7
2 changed files with 32 additions and 0 deletions
|
@ -187,3 +187,26 @@ def test_object_selector_schema(schema):
|
|||
def test_text_selector_schema(schema):
|
||||
"""Test text selector."""
|
||||
selector.validate_selector({"text": schema})
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"schema",
|
||||
({"options": ["red", "green", "blue"]},),
|
||||
)
|
||||
def test_select_selector_schema(schema):
|
||||
"""Test select selector."""
|
||||
selector.validate_selector({"select": schema})
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"schema",
|
||||
(
|
||||
{},
|
||||
{"options": {"hello": "World"}},
|
||||
{"options": []},
|
||||
),
|
||||
)
|
||||
def test_select_selector_schema_error(schema):
|
||||
"""Test select selector."""
|
||||
with pytest.raises(vol.Invalid):
|
||||
selector.validate_selector({"select": schema})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue