comparison planemo/lib/python3.7/site-packages/cwltool/tests/test_parallel.py @ 0:d30785e31577 draft

"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
author guerler
date Fri, 31 Jul 2020 00:18:57 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d30785e31577
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']}