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)
Esempio n. 2
0
 def test_load_unknown_schedule_raises(self):
     mock = mock_schedule.schedule(8)
     with self.assertRaises(ValueError):
         schedule.from_dict(mock)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
 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_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_manual_schedule_works(self):
     mock = mock_schedule.schedule(schedule.ScheduleFrequency.Manual)
     sched = schedule.from_dict(mock)
     self._expect(sched, 'Manually')