'Test for action with a list of weekdays.'

def test_if_action_list_weekday(self):

    assert setup_component(self.hass, automation.DOMAIN, {automation.DOMAIN: {'trigger': {'platform': 'event', 'event_type': 'test_event'}, 'condition': {'condition': 'time', 'weekday': ['mon', 'tue']}, 'action': {'service': 'test.automation'}}})
    days_past_monday = dt_util.now().weekday()
    monday = (dt_util.now() - timedelta(days=days_past_monday))
    tuesday = (monday + timedelta(days=1))
    wednesday = (tuesday + timedelta(days=1))
    with patch('homeassistant.helpers.condition.dt_util.now', return_value=monday):
        self.hass.bus.fire('test_event')
        self.hass.block_till_done()
    self.assertEqual(1, len(self.calls))
    with patch('homeassistant.helpers.condition.dt_util.now', return_value=tuesday):
        self.hass.bus.fire('test_event')
        self.hass.block_till_done()
    self.assertEqual(2, len(self.calls))
    with patch('homeassistant.helpers.condition.dt_util.now', return_value=wednesday):
        self.hass.bus.fire('test_event')
        self.hass.block_till_done()
    self.assertEqual(2, len(self.calls))
