6
6
## Creation : 01-02-2017
7
7
8
8
'''
9
- Unit tests for pycwl library
9
+ Unit tests for cwlgen library
10
10
'''
11
11
12
12
########### Import ###########
17
17
import unittest
18
18
19
19
# External libraries
20
- import pycwl
20
+ import cwlgen
21
21
22
22
# Class and Objects
23
23
30
30
class TestCommandLineTool (unittest .TestCase ):
31
31
32
32
def setUp (self ):
33
- self .cwl = pycwl .CommandLineTool (tool_id = 'an_id' , label = 'a description ' + \
33
+ self .cwl = cwlgen .CommandLineTool (tool_id = 'an_id' , label = 'a description ' + \
34
34
'with spaces.' , base_command = 'a_command' )
35
35
36
36
def test_init (self ):
@@ -55,9 +55,9 @@ def test_full_export(self):
55
55
tmp_file = 'test_full_export.tmp'
56
56
expected_file = os.path.dirname(__file__) + '/test_full_export.cwl'
57
57
self.cwl.doc = "documentation"
58
- an_input = pycwl .CommandInputParameter('an_in_id', param_type='File')
58
+ an_input = cwlgen .CommandInputParameter('an_in_id', param_type='File')
59
59
self.cwl.inputs.append(an_input)
60
- an_output = pycwl .CommandOutputParameter('an_out_id', param_type='File')
60
+ an_output = cwlgen .CommandOutputParameter('an_out_id', param_type='File')
61
61
self.cwl.outputs.append(an_output)
62
62
self.cwl.export(tmp_file)
63
63
try:
@@ -69,7 +69,7 @@ def test_full_export(self):
69
69
class TestParameter (unittest .TestCase ):
70
70
71
71
def setUp (self ):
72
- self .param = pycwl .Parameter ('an_id' , param_type = 'File' , label = 'a_label' ,\
72
+ self .param = cwlgen .Parameter ('an_id' , param_type = 'File' , label = 'a_label' ,\
73
73
doc = 'a_doc' , param_format = 'a_format' ,\
74
74
streamable = True , secondary_files = 'sec_files' )
75
75
@@ -95,11 +95,11 @@ def test_get_dict(self):
95
95
class TestCommandInputParameter (unittest .TestCase ):
96
96
97
97
def setUp (self ):
98
- self .frst_inp = pycwl .CommandInputParameter ('frst_id' , param_type = 'File' ,\
98
+ self .frst_inp = cwlgen .CommandInputParameter ('frst_id' , param_type = 'File' ,\
99
99
label = 'a_label' , \
100
100
default = 'def_value' )
101
- binding = pycwl .CommandLineBinding (position = 2 , prefix = '--prefix' )
102
- self .scnd_inp = pycwl .CommandInputParameter ('scnd_id' , param_type = 'File' ,\
101
+ binding = cwlgen .CommandLineBinding (position = 2 , prefix = '--prefix' )
102
+ self .scnd_inp = cwlgen .CommandInputParameter ('scnd_id' , param_type = 'File' ,\
103
103
input_binding = binding )
104
104
105
105
def test_init (self ):
@@ -130,7 +130,7 @@ def test_get_dict(self):
130
130
class TestCommandOutputParameter (unittest .TestCase ):
131
131
132
132
def setUp (self ):
133
- self .outp = pycwl .CommandOutputParameter ('an_out_id' , param_type = 'File' )
133
+ self .outp = cwlgen .CommandOutputParameter ('an_out_id' , param_type = 'File' )
134
134
135
135
def test_init (self ):
136
136
self .assertEqual (self .outp .id , 'an_out_id' )
@@ -144,7 +144,7 @@ def test_get_dict(self):
144
144
class TestCommandLineBinding (unittest .TestCase ):
145
145
146
146
def setUp (self ):
147
- self .line_binding = pycwl .CommandLineBinding (load_contents = True , position = 1 , \
147
+ self .line_binding = cwlgen .CommandLineBinding (load_contents = True , position = 1 , \
148
148
prefix = '--prefix' , separate = True , \
149
149
item_separator = '-' , shell_quote = True ,\
150
150
value_from = 'text.txt' )
@@ -171,7 +171,7 @@ def test_get_dict(self):
171
171
class TestCommandOutputBinding (unittest .TestCase ):
172
172
173
173
def setUp (self ):
174
- self .out_binding = pycwl .CommandOutputBinding (glob = 'file.txt' , load_contents = True ,\
174
+ self .out_binding = cwlgen .CommandOutputBinding (glob = 'file.txt' , load_contents = True ,\
175
175
output_eval = 'eval' )
176
176
177
177
def test_init (self ):
@@ -189,7 +189,7 @@ def test_get_dict(self):
189
189
class TestRequirement (unittest .TestCase ):
190
190
191
191
def setUp (self ):
192
- self .requirement = pycwl .Requirement ('a_class' )
192
+ self .requirement = cwlgen .Requirement ('a_class' )
193
193
194
194
def test_init (self ):
195
195
self .assertEqual (self .requirement .req_class , 'a_class' )
@@ -198,7 +198,7 @@ def test_init(self):
198
198
class TestInlineJavascriptReq (unittest .TestCase ):
199
199
200
200
def setUp (self ):
201
- self .js_req = pycwl .InlineJavascriptReq (expression_lib = 'expression' )
201
+ self .js_req = cwlgen .InlineJavascriptReq (expression_lib = 'expression' )
202
202
203
203
def test_init (self ):
204
204
self .assertEqual (self .js_req .req_class , 'InlineJavascriptRequirement' )
@@ -207,7 +207,7 @@ def test_init(self):
207
207
class TestDockerRequirement (unittest .TestCase ):
208
208
209
209
def setUp (self ):
210
- self .dock_req = pycwl .DockerRequirement (docker_pull = 'pull' , docker_load = 'load' ,\
210
+ self .dock_req = cwlgen .DockerRequirement (docker_pull = 'pull' , docker_load = 'load' ,\
211
211
docker_file = 'file' , docker_import = 'import' ,\
212
212
docker_image_id = 'id' , docker_output_dir = 'dir' )
213
213
0 commit comments