'Test toggling alert.'

def test_toggle(self):

    assert setup_component(self.hass, alert.DOMAIN, TEST_CONFIG)
    self.hass.states.set('sensor.test', STATE_ON)
    self.hass.block_till_done()
    self.assertEqual(STATE_ON, self.hass.states.get(ENTITY_ID).state)
    alert.toggle(self.hass, ENTITY_ID)
    self.hass.block_till_done()
    self.assertEqual(STATE_OFF, self.hass.states.get(ENTITY_ID).state)
    alert.toggle(self.hass, ENTITY_ID)
    self.hass.block_till_done()
    self.assertEqual(STATE_ON, self.hass.states.get(ENTITY_ID).state)
