コード例 #1
0
    def test_executor(self):
        settings.configure({'executor': {'type': 'DummyExecutor'}})

        executee = Executor()

        self.assertIsNotNone(Executor._connection)
        self.assertIsInstance(Executor._connection(), DummyExecutor)
        self.assertIsInstance(executee, DummyExecutor)
コード例 #2
0
 def test_executor_name_by_name(self):
     settings.configure(
         {'executor': {
             'type': 'concurrent.futures.ProcessPoolExecutor'
         }})
     self.assertIsInstance(Executor._connection(),
                           concurrent.futures.ProcessPoolExecutor)
コード例 #3
0
    def test_executor_name_celery(self):
        try:
            import terra.executor.celery
        except ImportError:
            raise SkipTest('Celery does not appear to be installed')

        settings.configure({'executor': {'type': 'CeleryExecutor'}})
        self.assertIsInstance(Executor._connection(),
                              terra.executor.celery.CeleryExecutor)
コード例 #4
0
 def test_executor_name_thread(self):
     settings.configure({'executor': {'type': 'ThreadPoolExecutor'}})
     self.assertIsInstance(Executor._connection(),
                           concurrent.futures.ThreadPoolExecutor)
コード例 #5
0
 def test_executor_name_sync(self):
     settings.configure({'executor': {'type': 'SyncExecutor'}})
     self.assertIsInstance(Executor._connection(), SyncExecutor)