def test_check_schedule_day_drift(self): '''Tests checking a schedule for once a day without slowly drifting away from the target time.''' last = job_test_utils.create_clock_event(occurred=datetime.datetime( 2015, 1, 9, 0, 45, 30, tzinfo=timezone.utc)) self.assertTrue( clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_hour_last(self): '''Tests checking an hourly schedule that was triggered before and is due now.''' last = job_test_utils.create_clock_event( occurred=datetime.datetime(2015, 1, 1, 11, tzinfo=timezone.utc)) self.assertTrue( clock._check_schedule(datetime.timedelta(hours=1), last))
def test_check_schedule_day_recover(self): '''Tests checking a schedule to recover after being down for several days.''' last = job_test_utils.create_clock_event(occurred=datetime.datetime( 2015, 1, 5, 0, 5, 50, tzinfo=timezone.utc)) self.assertTrue( clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_day_exact(self): '''Tests checking a schedule for once a day.''' last = job_test_utils.create_clock_event( occurred=datetime.datetime(2015, 1, 9, tzinfo=timezone.utc)) self.assertTrue( clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_day_last_skip(self): '''Tests checking a daily schedule that was triggered before and is not due.''' last = job_test_utils.create_clock_event( occurred=datetime.datetime(2015, 1, 10, tzinfo=timezone.utc)) self.assertFalse( clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_day_last_skip(self): '''Tests checking a daily schedule that was triggered before and is not due.''' last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 10, tzinfo=timezone.utc)) self.assertFalse(clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_day_first(self): '''Tests checking a daily schedule that was never triggered before and is due now.''' self.assertTrue(clock._check_schedule(datetime.timedelta(hours=24), None))
def test_check_schedule_day_first(self): """Tests checking a daily schedule that was never triggered before and is due now.""" self.assertTrue(clock._check_schedule(datetime.timedelta(hours=24), None))
def test_check_schedule_hour_recover(self): """Tests checking a schedule to recover after being down for several hours.""" last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 1, 5, tzinfo=utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=1), last))
def test_check_schedule_hour_last_skip(self): """Tests checking an hourly schedule that was triggered before and is not due.""" last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 1, 12, tzinfo=utc)) self.assertFalse(clock._check_schedule(datetime.timedelta(hours=1), last))
def test_check_schedule_day_drift(self): '''Tests checking a schedule for once a day without slowly drifting away from the target time.''' last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 9, 0, 45, 30, tzinfo=timezone.utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_hour_last_skip(self): """Tests checking an hourly schedule that was triggered before and is not due.""" last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 1, 12, tzinfo=timezone.utc)) self.assertFalse(clock._check_schedule(datetime.timedelta(hours=1), last))
def test_check_schedule_hour_first(self): """Tests checking an hourly schedule that was never triggered before and is due now.""" self.assertTrue(clock._check_schedule(datetime.timedelta(hours=1), None))
def test_check_schedule_day_exact(self): '''Tests checking a schedule for once a day.''' last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 9, tzinfo=timezone.utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_hour_recover(self): """Tests checking a schedule to recover after being down for several hours.""" last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 1, 5, tzinfo=timezone.utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=1), last))
def test_check_schedule_day_recover(self): '''Tests checking a schedule to recover after being down for several days.''' last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 5, 0, 5, 50, tzinfo=timezone.utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_hour_drift_min(self): """Tests checking a schedule for once an hour without slowly drifting away from the target time.""" last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 10, 8, tzinfo=timezone.utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=1), last))
def test_check_schedule_hour_first_skip(self): """Tests checking an hourly schedule that was never triggered before and is not due.""" self.assertFalse(clock._check_schedule(datetime.timedelta(hours=1), None))
def test_check_schedule_day_last(self): """Tests checking a daily schedule that was triggered before and is due now.""" last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 9, tzinfo=timezone.utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_hour_exact(self): """Tests checking a schedule for once an hour.""" last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 1, 9, tzinfo=utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=1), last))
def test_check_schedule_hour_first_skip(self): '''Tests checking an hourly schedule that was never triggered before and is not due.''' self.assertFalse(clock._check_schedule(datetime.timedelta(hours=1), None))
def test_check_schedule_hour_drift_min(self): """Tests checking a schedule for once an hour without slowly drifting away from the target time.""" last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 10, 8, tzinfo=utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=1), last))
def test_check_schedule_hour_last(self): '''Tests checking an hourly schedule that was triggered before and is due now.''' last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 1, 11, tzinfo=timezone.utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=1), last))
def test_check_schedule_day_last(self): """Tests checking a daily schedule that was triggered before and is due now.""" last = job_test_utils.create_clock_event(occurred=datetime.datetime(2015, 1, 9, tzinfo=utc)) self.assertTrue(clock._check_schedule(datetime.timedelta(hours=24), last))
def test_check_schedule_hour_first(self): '''Tests checking an hourly schedule that was never triggered before and is due now.''' self.assertTrue( clock._check_schedule(datetime.timedelta(hours=1), None))