mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 19:27:51 +00:00
Merge pull request #277 from theolind/dev
Added test for Automation component service id list
This commit is contained in:
commit
152fd9cb28
@ -78,3 +78,18 @@ class TestAutomationEvent(unittest.TestCase):
|
|||||||
self.hass.pool.block_till_done()
|
self.hass.pool.block_till_done()
|
||||||
self.assertEqual(1, len(self.calls))
|
self.assertEqual(1, len(self.calls))
|
||||||
self.assertEqual(['hello.world'], self.calls[0].data[ATTR_ENTITY_ID])
|
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])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user