'Test for firing on entity change with for.'

def test_if_fires_on_entity_change_with_for(self):

    assert setup_component(self.hass, automation.DOMAIN, {automation.DOMAIN: {'trigger': {'platform': 'state', 'entity_id': 'test.entity', 'to': 'world', 'for': {'seconds': 5}}, 'action': {'service': 'test.automation'}}})
    self.hass.states.set('test.entity', 'world')
    self.hass.block_till_done()
    fire_time_changed(self.hass, (dt_util.utcnow() + timedelta(seconds=10)))
    self.hass.block_till_done()
    self.assertEqual(1, len(self.calls))
