Mercurial > repos > shellac > guppy_basecaller
comparison env/lib/python3.7/site-packages/cwltool/tests/test_parallel.py @ 5:9b1c78e6ba9c draft default tip
"planemo upload commit 6c0a8142489327ece472c84e558c47da711a9142"
| author | shellac |
|---|---|
| date | Mon, 01 Jun 2020 08:59:25 -0400 |
| parents | 79f47841a781 |
| children |
comparison
equal
deleted
inserted
replaced
| 4:79f47841a781 | 5:9b1c78e6ba9c |
|---|---|
| 1 import json | |
| 2 | |
| 3 from cwltool.context import RuntimeContext | |
| 4 from cwltool.executors import MultithreadedJobExecutor | |
| 5 from cwltool import load_tool | |
| 6 | |
| 7 from .util import get_data, get_windows_safe_factory, windows_needs_docker | |
| 8 | |
| 9 | |
| 10 @windows_needs_docker | |
| 11 def test_sequential_workflow(tmpdir): | |
| 12 test_file = "tests/wf/count-lines1-wf.cwl" | |
| 13 executor = MultithreadedJobExecutor() | |
| 14 runtime_context = RuntimeContext() | |
| 15 runtime_context.outdir = str(tmpdir) | |
| 16 runtime_context.select_resources = executor.select_resources | |
| 17 factory = get_windows_safe_factory( | |
| 18 executor=executor, runtime_context=runtime_context) | |
| 19 echo = factory.make(get_data(test_file)) | |
| 20 file_contents = {"class": "File", | |
| 21 "location": get_data("tests/wf/whale.txt")} | |
| 22 assert echo(file1=file_contents) == {"count_output": 16} | |
| 23 | |
| 24 @windows_needs_docker | |
| 25 def test_scattered_workflow(): | |
| 26 test_file = "tests/wf/scatter-wf4.cwl" | |
| 27 job_file = "tests/wf/scatter-job2.json" | |
| 28 factory = get_windows_safe_factory(executor=MultithreadedJobExecutor()) | |
| 29 echo = factory.make(get_data(test_file)) | |
| 30 with open(get_data(job_file)) as job: | |
| 31 assert echo(**json.load(job)) == {'out': ['foo one three', 'foo two four']} |
