Ejemplo n.º 1
0
 def test_crontab_bad_kwargs(self):
     # By default, the apscheduler doesn't error when we give cron bad kwargs
     # This can lead to silently dropping args (e.g. when putting 'hours'
     # instead of 'hour'). It needs patching!
     try:
         crontab(seeecond=10, third=20)
     except:
         pass
     else:
         pass
Ejemplo n.º 2
0
    def test_crontab_similarity(self):
        crontab_a = crontab(hour=1)
        crontab_b = crontab(minute=10)
        crontab_c = crontab(hour=2)
        crontab_d = crontab(hour=2)
        crontab_e = crontab(hour=2, start_date=datetime.now() + timedelta(days=2))

        self.assertTrue(triggers_are_identical(crontab_a, crontab_a))
        self.assertFalse(triggers_are_identical(crontab_a, crontab_b))
        self.assertFalse(triggers_are_identical(crontab_a, crontab_c))
        self.assertTrue(triggers_are_identical(crontab_c, crontab_d))
        self.assertFalse(triggers_are_identical(crontab_c, crontab_e))