def test_load_weekly_schedule_works(self): mock = mock_schedule.schedule(schedule.ScheduleFrequency.Weekly, weekday=0, hour=0, minute=15) sched = schedule.from_dict(mock) self._expect(sched, 'Weekly', xweekday='Sunday', xhour=0, xperiod='AM', xminute=15)
def test_load_unknown_schedule_raises(self): mock = mock_schedule.schedule(8) with self.assertRaises(ValueError): schedule.from_dict(mock)
def test_load_hourly_schedule_works(self): mock = mock_schedule.schedule(schedule.ScheduleFrequency.Hourly, interval=4) sched = schedule.from_dict(mock) self._expect(sched, "Hourly", xinterval=4)
def test_load_daily_schedule_works(self): mock = mock_schedule.schedule(schedule.ScheduleFrequency.Daily, hour=13, minute=15) sched = schedule.from_dict(mock) self._expect(sched, "Daily", xhour=1, xperiod="PM", xminute=15)
def test_load_weekly_schedule_works(self): mock = mock_schedule.schedule(schedule.ScheduleFrequency.Weekly, weekday=0, hour=0, minute=15) sched = schedule.from_dict(mock) self._expect(sched, "Weekly", xweekday="Sunday", xhour=0, xperiod="AM", xminute=15)
def test_load_manual_schedule_works(self): mock = mock_schedule.schedule(schedule.ScheduleFrequency.Manual) sched = schedule.from_dict(mock) self._expect(sched, "Manually")
def test_load_hourly_schedule_works(self): mock = mock_schedule.schedule(schedule.ScheduleFrequency.Hourly, interval=4) sched = schedule.from_dict(mock) self._expect(sched, 'Hourly', xinterval=4)
def test_load_daily_schedule_works(self): mock = mock_schedule.schedule(schedule.ScheduleFrequency.Daily, hour=13, minute=15) sched = schedule.from_dict(mock) self._expect(sched, 'Daily', xhour=1, xperiod='PM', xminute=15)
def test_load_manual_schedule_works(self): mock = mock_schedule.schedule(schedule.ScheduleFrequency.Manual) sched = schedule.from_dict(mock) self._expect(sched, 'Manually')