From a59460a23336627d0bc12b1eefffdaa516e55e87 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 8 Apr 2021 13:04:39 -0700 Subject: [PATCH] Test that we do not initialize bad configuration (#48872) * Test that we do not initialize bad configuration * Simplify test as we are not calling a service --- tests/components/automation/test_init.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/components/automation/test_init.py b/tests/components/automation/test_init.py index 71727258fcc..5997be22644 100644 --- a/tests/components/automation/test_init.py +++ b/tests/components/automation/test_init.py @@ -1357,6 +1357,26 @@ async def test_blueprint_automation(hass, calls): ] +async def test_blueprint_automation_bad_config(hass, caplog): + """Test blueprint automation with bad inputs.""" + assert await async_setup_component( + hass, + "automation", + { + "automation": { + "use_blueprint": { + "path": "test_event_service.yaml", + "input": { + "trigger_event": "blueprint_event", + "service_to_call": {"dict": "not allowed"}, + }, + } + } + }, + ) + assert "generated invalid automation" in caplog.text + + async def test_trigger_service(hass, calls): """Test the automation trigger service.""" assert await async_setup_component(