From cbcd6d458ee81b928322c5c578e5adaa27e7332b Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 21 Dec 2021 14:10:05 +0100 Subject: [PATCH] Assert current state of script condition validation in tests (#62486) --- tests/helpers/test_config_validation.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/helpers/test_config_validation.py b/tests/helpers/test_config_validation.py index 0c32ae5eddf..62ae79ec5cc 100644 --- a/tests/helpers/test_config_validation.py +++ b/tests/helpers/test_config_validation.py @@ -1229,6 +1229,16 @@ def test_script(caplog): ({"delay": "{{ invalid"}, "should be format 'HH:MM'"), ({"wait_template": "{{ invalid"}, "invalid template"), ({"condition": "invalid"}, "Unexpected value for condition: 'invalid'"), + ( + {"condition": "not", "conditions": {"condition": "invalid"}}, + "Unexpected value for condition: 'invalid'", + ), + # The validation error message could be improved to explain that this is not + # a valid shorthand template + ( + {"condition": "not", "conditions": "not a dynamic template"}, + "Expected a dictionary", + ), ({"event": None}, "string value is None for dictionary value @ data['event']"), ( {"device_id": None},