From 089cd0ff8ae26cccf46e127dd1c18e4ffd69b612 Mon Sep 17 00:00:00 2001 From: theolind Date: Tue, 25 Aug 2015 06:50:20 +0200 Subject: [PATCH] Added test for Automation component service id list --- tests/components/automation/test_init.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/components/automation/test_init.py b/tests/components/automation/test_init.py index 2af17ea405c..507c37dc20a 100644 --- a/tests/components/automation/test_init.py +++ b/tests/components/automation/test_init.py @@ -78,3 +78,18 @@ class TestAutomationEvent(unittest.TestCase): self.hass.pool.block_till_done() self.assertEqual(1, len(self.calls)) self.assertEqual(['hello.world'], self.calls[0].data[ATTR_ENTITY_ID]) + + def test_service_specify_entity_id_list(self): + automation.setup(self.hass, { + automation.DOMAIN: { + CONF_PLATFORM: 'event', + event.CONF_EVENT_TYPE: 'test_event', + automation.CONF_SERVICE: 'test.automation', + automation.CONF_SERVICE_ENTITY_ID: ['hello.world', 'hello.world2'] + } + }) + + self.hass.bus.fire('test_event') + self.hass.pool.block_till_done() + self.assertEqual(1, len(self.calls)) + self.assertEqual(['hello.world', 'hello.world2'], self.calls[0].data[ATTR_ENTITY_ID])