File: test_iwdr.py

package info (click to toggle)
cwltool 1.0.20181217162649%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,632 kB
  • sloc: python: 11,008; makefile: 153; sh: 22
file content (118 lines) | stat: -rw-r--r-- 6,408 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import tempfile
from cwltool.main import main
from cwltool import load_tool
from .util import (get_data, get_windows_safe_factory, windows_needs_docker,
                   needs_docker, temp_dir, needs_singularity)

@windows_needs_docker
def test_newline_in_entry():
    """
    test that files in InitialWorkingDirectory are created with a newline character
    """
    factory = get_windows_safe_factory()
    echo = factory.make(get_data("tests/wf/iwdr-entry.cwl"))
    assert echo(message="hello") == {"out": "CONFIGVAR=hello\n"}

@needs_docker
def test_iwdr_permutations():
    load_tool.loaders = {}
    with temp_dir() as fifth:
        with temp_dir() as sixth:
            with temp_dir() as seventh:
                with temp_dir() as eighth:
                    with tempfile.NamedTemporaryFile() as first:
                        with tempfile.NamedTemporaryFile() as second:
                            with tempfile.NamedTemporaryFile() as third:
                                with tempfile.NamedTemporaryFile() as fourth:
                                    with temp_dir() as outdir:
                                        assert(main(
                                            ['--outdir', outdir,
                                             get_data("tests/wf/iwdr_permutations.cwl"),
                                             '--first', first.name,
                                             '--second', second.name,
                                             '--third', third.name,
                                             '--fourth', fourth.name,
                                             '--fifth', fifth,
                                             '--sixth', sixth,
                                             '--seventh', seventh,
                                             '--eighth', eighth]) == 0)

@needs_docker
def test_iwdr_permutations_inplace():
    load_tool.loaders = {}
    with temp_dir() as fifth:
        with temp_dir() as sixth:
            with temp_dir() as seventh:
                with temp_dir() as eighth:
                    with tempfile.NamedTemporaryFile() as first:
                        with tempfile.NamedTemporaryFile() as second:
                            with tempfile.NamedTemporaryFile() as third:
                                with tempfile.NamedTemporaryFile() as fourth:
                                    with temp_dir() as outdir:
                                        assert(main(
                                            ['--outdir', outdir,
                                             '--enable-ext',
                                             '--overrides',
                                             get_data("tests/wf/iwdr_permutations_inplace.yml"),
                                             get_data("tests/wf/iwdr_permutations.cwl"),
                                             '--first', first.name,
                                             '--second', second.name,
                                             '--third', third.name,
                                             '--fourth', fourth.name,
                                             '--fifth', fifth,
                                             '--sixth', sixth,
                                             '--seventh', seventh,
                                             '--eighth', eighth]) == 0)

@needs_singularity
def test_iwdr_permutations_singularity():
    load_tool.loaders = {}
    with temp_dir() as fifth:
        with temp_dir() as sixth:
            with temp_dir() as seventh:
                with temp_dir() as eighth:
                    with tempfile.NamedTemporaryFile() as first:
                        with tempfile.NamedTemporaryFile() as second:
                            with tempfile.NamedTemporaryFile() as third:
                                with tempfile.NamedTemporaryFile() as fourth:
                                    with temp_dir() as outdir:
                                        assert(main(
                                            ['--outdir', outdir,
                                             '--singularity',
                                             get_data("tests/wf/iwdr_permutations.cwl"),
                                             '--first', first.name,
                                             '--second', second.name,
                                             '--third', third.name,
                                             '--fourth', fourth.name,
                                             '--fifth', fifth,
                                             '--sixth', sixth,
                                             '--seventh', seventh,
                                             '--eighth', eighth]) == 0)

@needs_singularity
def test_iwdr_permutations_singularity_inplace():
    load_tool.loaders = {}
    with temp_dir() as fifth:
        with temp_dir() as sixth:
            with temp_dir() as seventh:
                with temp_dir() as eighth:
                    with tempfile.NamedTemporaryFile() as first:
                        with tempfile.NamedTemporaryFile() as second:
                            with tempfile.NamedTemporaryFile() as third:
                                with tempfile.NamedTemporaryFile() as fourth:
                                    with temp_dir() as outdir:
                                        assert(main(
                                            ['--outdir', outdir,
                                             '--singularity',
                                             '--enable-ext',
                                             '--overrides',
                                             get_data("tests/wf/iwdr_permutations_inplace.yml"),
                                             get_data("tests/wf/iwdr_permutations.cwl"),
                                             '--first', first.name,
                                             '--second', second.name,
                                             '--third', third.name,
                                             '--fourth', fourth.name,
                                             '--fifth', fifth,
                                             '--sixth', sixth,
                                             '--seventh', seventh,
                                             '--eighth', eighth]) == 0)