'Test the firing of events.'

def test_if_fires_on_event(self):

    assert setup_component(self.hass, automation.DOMAIN, {automation.DOMAIN: {'trigger': {'platform': 'event', 'event_type': 'test_event'}, 'action': {'service': 'test.automation'}}})
    self.hass.bus.fire('test_event')
    self.hass.block_till_done()
    self.assertEqual(1, len(self.calls))
    automation.turn_off(self.hass)
    self.hass.block_till_done()
    self.hass.bus.fire('test_event')
    self.hass.block_till_done()
    self.assertEqual(1, len(self.calls))
