def test_start(self): s, sh = self.get_service() schedule = s.scheduler.schedule assert isinstance(schedule, dict) assert isinstance(s.scheduler, beat.Scheduler) scheduled = list(schedule.keys()) for task_name in keys(sh[str('entries')]): assert task_name in scheduled s.sync() assert sh.closed assert sh.synced assert s._is_stopped.isSet() s.sync() s.stop(wait=False) assert s._is_shutdown.isSet() s.stop(wait=True) assert s._is_shutdown.isSet() p = s.scheduler._store s.scheduler._store = None try: s.scheduler.sync() finally: s.scheduler._store = p
def test_start(self): s, sh = self.get_service() schedule = s.scheduler.schedule self.assertIsInstance(schedule, dict) self.assertIsInstance(s.scheduler, beat.Scheduler) scheduled = schedule.keys() for task_name in sh['entries'].keys(): self.assertIn(task_name, scheduled) s.sync() self.assertTrue(sh.closed) self.assertTrue(sh.synced) self.assertTrue(s._is_stopped.isSet()) s.sync() s.stop(wait=False) self.assertTrue(s._is_shutdown.isSet()) s.stop(wait=True) self.assertTrue(s._is_shutdown.isSet()) p = s.scheduler._store s.scheduler._store = None try: s.scheduler.sync() finally: s.scheduler._store = p
def test_start(self): s, sh = self.get_service() schedule = s.scheduler.schedule self.assertIsInstance(schedule, dict) self.assertIsInstance(s.scheduler, beat.Scheduler) scheduled = schedule.keys() for task_name in sh["entries"].keys(): self.assertIn(task_name, scheduled) s.sync() self.assertTrue(sh.closed) self.assertTrue(sh.synced) self.assertTrue(s._is_stopped.isSet()) s.sync() s.stop(wait=False) self.assertTrue(s._is_shutdown.isSet()) s.stop(wait=True) self.assertTrue(s._is_shutdown.isSet()) p = s.scheduler._store s.scheduler._store = None try: s.scheduler.sync() finally: s.scheduler._store = p