def test_executor(self): settings.configure({'executor': {'type': 'DummyExecutor'}}) executee = Executor() self.assertIsNotNone(Executor._connection) self.assertIsInstance(Executor._connection(), DummyExecutor) self.assertIsInstance(executee, DummyExecutor)
def test_executor_name_by_name(self): settings.configure( {'executor': { 'type': 'concurrent.futures.ProcessPoolExecutor' }}) self.assertIsInstance(Executor._connection(), concurrent.futures.ProcessPoolExecutor)
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)
def test_executor_name_thread(self): settings.configure({'executor': {'type': 'ThreadPoolExecutor'}}) self.assertIsInstance(Executor._connection(), concurrent.futures.ThreadPoolExecutor)
def test_executor_name_sync(self): settings.configure({'executor': {'type': 'SyncExecutor'}}) self.assertIsInstance(Executor._connection(), SyncExecutor)