Mercurial > repos > shellac > guppy_basecaller
comparison env/lib/python3.7/site-packages/cwltool/tests/test_parallel.py @ 0:26e78fe6e8c4 draft
"planemo upload commit c699937486c35866861690329de38ec1a5d9f783"
author | shellac |
---|---|
date | Sat, 02 May 2020 07:14:21 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:26e78fe6e8c4 |
---|---|
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']} |