|
1 | 1 | import json
|
2 |
| -import unittest |
3 | 2 |
|
4 | 3 | from cwltool.context import RuntimeContext
|
5 | 4 | from cwltool.executors import MultithreadedJobExecutor
|
6 | 5 |
|
7 | 6 | from .util import get_data, get_windows_safe_factory, windows_needs_docker
|
8 | 7 |
|
9 | 8 |
|
10 |
| -class TestParallel(unittest.TestCase): |
11 |
| - @windows_needs_docker |
12 |
| - def test_sequential_workflow(self): |
13 |
| - test_file = "tests/wf/count-lines1-wf.cwl" |
14 |
| - executor = MultithreadedJobExecutor() |
15 |
| - runtime_context = RuntimeContext() |
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 |
| - self.assertEqual( |
21 |
| - echo(file1={"class": "File", |
22 |
| - "location": get_data("tests/wf/whale.txt")}), |
23 |
| - {"count_output": 16}) |
| 9 | +@windows_needs_docker |
| 10 | +def test_sequential_workflow(): |
| 11 | + test_file = "tests/wf/count-lines1-wf.cwl" |
| 12 | + executor = MultithreadedJobExecutor() |
| 13 | + runtime_context = RuntimeContext() |
| 14 | + runtime_context.select_resources = executor.select_resources |
| 15 | + factory = get_windows_safe_factory( |
| 16 | + executor=executor, runtime_context=runtime_context) |
| 17 | + echo = factory.make(get_data(test_file)) |
| 18 | + file_contents = {"class": "File", |
| 19 | + "location": get_data("tests/wf/whale.txt")} |
| 20 | + assert echo(file1=file_contents) == {"count_output": 16} |
24 | 21 |
|
25 |
| - @windows_needs_docker |
26 |
| - def test_scattered_workflow(self): |
27 |
| - test_file = "tests/wf/scatter-wf4.cwl" |
28 |
| - job_file = "tests/wf/scatter-job2.json" |
29 |
| - f = get_windows_safe_factory(executor=MultithreadedJobExecutor()) |
30 |
| - echo = f.make(get_data(test_file)) |
31 |
| - with open(get_data(job_file)) as job: |
32 |
| - self.assertEqual(echo(**json.load(job)), {'out': ['foo one three', 'foo two four']}) |
| 22 | +@windows_needs_docker |
| 23 | +def test_scattered_workflow(): |
| 24 | + test_file = "tests/wf/scatter-wf4.cwl" |
| 25 | + job_file = "tests/wf/scatter-job2.json" |
| 26 | + factory = get_windows_safe_factory(executor=MultithreadedJobExecutor()) |
| 27 | + echo = factory.make(get_data(test_file)) |
| 28 | + with open(get_data(job_file)) as job: |
| 29 | + assert echo(**json.load(job)) == {'out': ['foo one three', 'foo two four']} |
0 commit comments