Ejemplo n.º 1
0
    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))
Ejemplo n.º 2
0
    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))
Ejemplo n.º 3
0
    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))
Ejemplo n.º 4
0
    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))
Ejemplo n.º 5
0
    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))
Ejemplo n.º 6
0
    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))
Ejemplo n.º 7
0
 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))
Ejemplo n.º 8
0
 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))
Ejemplo n.º 9
0
    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))
Ejemplo n.º 10
0
    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))
Ejemplo n.º 11
0
    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))
Ejemplo n.º 12
0
    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))
Ejemplo n.º 13
0
 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))
Ejemplo n.º 14
0
    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))
Ejemplo n.º 15
0
    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))
Ejemplo n.º 16
0
    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))
Ejemplo n.º 17
0
    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))
Ejemplo n.º 18
0
 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))
Ejemplo n.º 19
0
    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))
Ejemplo n.º 20
0
    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))
Ejemplo n.º 21
0
 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))
Ejemplo n.º 22
0
    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))
Ejemplo n.º 23
0
    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))
Ejemplo n.º 24
0
    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))
Ejemplo n.º 25
0
 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))