def test_bad_task(self): check = main.CheckSchedule() tasks = check.runwith( itt=timeutil.parse_time("2020-08-27 07:30:05"), sched_cfg=[ ["TakeMeasurement_X", 'minutes', 30, 0], ["Communicate", 'daily', 3, 15], ]) self.assertEqual(tasks, [])
def test_clock_drift_reset_internal(self): check = main.CheckSchedule() tasks = check.runwith( itt=timeutil.parse_time("1970-01-01 00:30:10"), ett=timeutil.parse_time("2020-08-27 07:28:05"), sched_cfg=[ ["TakeMeasurement", 'minutes', 30, 0], ["Communicate", 'daily', 3, 15], ]) # Do the task that we woke up for. # Otherwise it may never get done. self.assertEqual(tasks, [main.TakeMeasurement])
def test_clock_drift_wake_early(self): check = main.CheckSchedule() tasks = check.runwith( itt=timeutil.parse_time("2020-08-27 07:30:05"), ett=timeutil.parse_time("2020-08-27 07:28:05"), sched_cfg=[ ["TakeMeasurement", 'minutes', 30, 0], ["Communicate", 'daily', 3, 15], ]) # Don't schedule anything. # We will sync RTCs and wake up again on time self.assertEqual(tasks, [])