Exemplo n.º 1
0
    def test_create_scheduler_no_blocking(self):
        config = SchedulerConfiguration()
        config._blocking = False

        self.assertIsNotNone(config)
        scheduler = ProgramyScheduler(self._test_client, config)
        self.assertIsNotNone(scheduler)
        self.assertIsInstance(scheduler._scheduler, BackgroundScheduler)
Exemplo n.º 2
0
    def test_create_scheduler_blocking_with_jobstore(self):
        config = SchedulerConfiguration()
        config._blocking = True

        config._jobstore = SchedulerJobStoreConfiguration()
        config._jobstore._name = "sqlalchemy"
        config._jobstore._storage = SchedulerSqlAlchemyJobStoreConfiguration()
        config._jobstore._storage._url = "sqlite:///programy.sqlite"

        scheduler = ProgramyScheduler(self._test_client, config)
        self.assertIsNotNone(scheduler)
        self.assertIsInstance(scheduler._scheduler, BlockingScheduler)