@@ -61,6 +61,10 @@ def setUp(self):
61
61
self .param = cwlgen .Parameter ('an_id' , param_type = 'File' , label = 'a_label' ,\
62
62
doc = 'a_doc' , param_format = 'a_format' ,\
63
63
streamable = True , secondary_files = 'sec_files' )
64
+ self .nonfile_param = cwlgen .Parameter ('non-file' , param_type = "string" , label = "a string" ,
65
+ streamable = True , secondary_files = [".txt" ], doc = "documentation here" )
66
+
67
+ self .array_param = cwlgen .Parameter ('an array' , param_type = 'string[]' , label = "an array of strings" )
64
68
65
69
def test_init (self ):
66
70
self .assertEqual (self .param .id , 'an_id' )
@@ -80,6 +84,21 @@ def test_get_dict(self):
80
84
self .assertEqual (dict_test ['secondaryFiles' ], 'sec_files' )
81
85
self .assertTrue (dict_test ['streamable' ])
82
86
87
+ def test_nonfile_get_dict (self ):
88
+ dict_test = self .nonfile_param .get_dict ()
89
+ self .assertEqual (dict_test ['type' ], 'string' )
90
+ self .assertEqual (dict_test ['doc' ], self .nonfile_param .doc )
91
+ self .assertNotIn ('secondaryFiles' , dict_test )
92
+ self .assertNotIn ('streamable' , dict_test )
93
+ self .assertNotIn ('format' , dict_test )
94
+
95
+ def test_array (self ):
96
+ dict_test = self .array_param .get_dict ()
97
+ td = dict_test ['type' ]
98
+ self .assertIsInstance (td , dict )
99
+ self .assertEqual (td ['type' ], 'array' )
100
+ self .assertEqual (td ['items' ], self .array_param .type .items )
101
+
83
102
84
103
class TestCommandInputParameter (unittest .TestCase ):
85
104
0 commit comments