'Test if action was after.'

def test_if_action_after(self):

    setup_component(self.hass, automation.DOMAIN, {automation.DOMAIN: {'trigger': {'platform': 'event', 'event_type': 'test_event'}, 'condition': {'condition': 'sun', 'after': 'sunrise'}, 'action': {'service': 'test.automation'}}})
    now = datetime(2015, 9, 16, 13, tzinfo=dt_util.UTC)
    with patch('homeassistant.util.dt.utcnow', return_value=now):
        self.hass.bus.fire('test_event')
        self.hass.block_till_done()
        self.assertEqual(0, len(self.calls))
    now = datetime(2015, 9, 16, 15, tzinfo=dt_util.UTC)
    with patch('homeassistant.util.dt.utcnow', return_value=now):
        self.hass.bus.fire('test_event')
        self.hass.block_till_done()
        self.assertEqual(1, len(self.calls))
