def test_is_scheduled(self):
     self.assertTrue(ingest.is_scheduled({}), 'run after create')
     self.assertFalse(ingest.is_scheduled({'last_updated': utcnow()}), 'wait default time 5m')
     self.assertTrue(ingest.is_scheduled({'last_updated': utcnow() - timedelta(minutes=6)}), 'run after 5m')
     self.assertFalse(ingest.is_scheduled({
         'last_updated': utcnow() - timedelta(minutes=6),
         'update_schedule': {'minutes': 10}
     }), 'or wait if provider has specific schedule')
     self.assertTrue(ingest.is_scheduled({
         'last_updated': utcnow() - timedelta(minutes=11),
         'update_schedule': {'minutes': 10}
     }), 'and run eventually')
 def test_is_scheduled(self):
     self.assertTrue(is_scheduled({}), 'for first time it should run')
     self.assertFalse(is_scheduled({'last_updated': utcnow()}), 'then it should wait default time 5m')
     self.assertTrue(is_scheduled({'last_updated': utcnow() - timedelta(minutes=6)}), 'after 5m it should run again')
     self.assertFalse(is_scheduled({
         'last_updated': utcnow() - timedelta(minutes=6),
         'update_schedule': {'minutes': 10}
     }), 'or wait if provider has specific schedule')
     self.assertTrue(is_scheduled({
         'last_updated': utcnow() - timedelta(minutes=11),
         'update_schedule': {'minutes': 10}
     }), 'and run eventually')
Пример #3
0
 def test_is_scheduled(self):
     self.assertTrue(ingest.is_scheduled({}), 'run after create')
     self.assertFalse(ingest.is_scheduled({'last_updated': utcnow()}), 'wait default time 5m')
     self.assertTrue(ingest.is_scheduled({'last_updated': utcnow() - timedelta(minutes=6)}), 'run after 5m')
     self.assertFalse(ingest.is_scheduled({
         'last_updated': utcnow() - timedelta(minutes=6),
         'update_schedule': {'minutes': 10}
     }), 'or wait if provider has specific schedule')
     self.assertTrue(ingest.is_scheduled({
         'last_updated': utcnow() - timedelta(minutes=11),
         'update_schedule': {'minutes': 10}
     }), 'and run eventually')
 def test_is_scheduled(self):
     self.assertTrue(is_scheduled({}), 'for first time it should run')
     self.assertFalse(is_scheduled({'last_updated': utcnow()}),
                      'then it should wait default time 5m')
     self.assertTrue(
         is_scheduled({'last_updated': utcnow() - timedelta(minutes=6)}),
         'after 5m it should run again')
     self.assertFalse(
         is_scheduled({
             'last_updated': utcnow() - timedelta(minutes=6),
             'update_schedule': {
                 'minutes': 10
             }
         }), 'or wait if provider has specific schedule')
     self.assertTrue(
         is_scheduled({
             'last_updated': utcnow() - timedelta(minutes=11),
             'update_schedule': {
                 'minutes': 10
             }
         }), 'and run eventually')