def test_file_inputs_python(self): mock = tasks.file_python_inputs_mock h = ExecutionHandler() _task = OrcaTask(mock, h.resolve_task_inputs(mock)) h.handle_python(_task) assert 'result' in _task.locals assert _task.locals['result'] == 25
def test_inline_python(self): mock = tasks.inline_python_mock h = ExecutionHandler() _task = OrcaTask(mock, h.resolve_task_inputs(mock)) h.handle_python(_task) assert 'greeting' in _task.locals assert _task.locals['greeting'] == 'Hello World'
def run(ledger_json, ledger_mongo, ledger_kafka, file, args): """ Run an orca workflow. """ try: ledger = None if ledger_json: ledger = JSONFileLedger(ledger_json) elif ledger_mongo: ledger = MongoLedger(ledger_mongo) elif ledger_kafka: ledger = KafkaLedger(ledger_kafka) config = OrcaConfig.create(file, args) executor = ExecutionHandler(ledger) executor.handle(config) except OrcaError as e: log.error(e)
def test_comprehensive_example(self): run_handler('datetime.yaml', ExecutionHandler())
def test_bad_python_func(self): with self.assertRaises(ExecutionError): run_handler('bad_python_func.yaml', ExecutionHandler())
def test_python_func(self): run_handler('python_funcs.yaml', ExecutionHandler())
def test_var4_task(self): run_handler('var4.yaml', ExecutionHandler())
def test_switch_task(self): run_handler('switch.yaml', ExecutionHandler())
def test_for_task(self): run_handler('for.yaml', ExecutionHandler())
def test_csip_task(self): run_handler('csip.yaml', ExecutionHandler())
def test_inline_bash_task(self): run_handler('bash-inline.yaml', ExecutionHandler())
def test_simple_python(self): run_handler('python.yaml', ExecutionHandler())
def test_imports_example(self): run_handler('imports.yaml', ExecutionHandler())