@@ -64,7 +64,11 @@ def test_example_cwl_simple_redirect():
6464
6565
6666def test_prefixes_separated ():
67- command_io = _example ("seqtk convert -i '1.bed' --output '1.bam'" , example_outputs = ["1.bam" ], example_inputs = ["1.bed" ])
67+ command_io = _example (
68+ "seqtk convert -i '1.bed' --output '1.bam'" ,
69+ example_outputs = ["1.bam" ],
70+ example_inputs = ["1.bed" ]
71+ )
6872 cwl_properties = command_io .cwl_properties ()
6973 _assert_eq (cwl_properties ["base_command" ], ["seqtk" , "convert" ])
7074 _assert_eq (cwl_properties ["inputs" ][0 ].position , 1 )
@@ -78,7 +82,11 @@ def test_prefixes_separated():
7882
7983
8084def test_prefixes_joined ():
81- command_io = _example ("seqtk convert INPUT=1.bed OUTPUT=1.bam" , example_outputs = ["1.bam" ], example_inputs = ["1.bed" ])
85+ command_io = _example (
86+ "seqtk convert INPUT=1.bed OUTPUT=1.bam" ,
87+ example_outputs = ["1.bam" ],
88+ example_inputs = ["1.bed" ]
89+ )
8290 cwl_properties = command_io .cwl_properties ()
8391 _assert_eq (cwl_properties ["base_command" ], ["seqtk" , "convert" ])
8492 _assert_eq (cwl_properties ["inputs" ][0 ].position , 1 )
@@ -91,6 +99,35 @@ def test_prefixes_joined():
9199 _assert_eq (cwl_properties ["stdout" ], None )
92100
93101
102+ def test_integer_parameters ():
103+ command_io = _example (
104+ "seqtk convert --size 100 -i '1.bed' --threshold 2.0 --output_type bam > '1.bam'" ,
105+ example_outputs = ["1.bam" ],
106+ example_inputs = ["1.bed" ]
107+ )
108+ cwl_properties = command_io .cwl_properties ()
109+ _assert_eq (cwl_properties ["base_command" ], ["seqtk" , "convert" ])
110+ _assert_eq (len (cwl_properties ["inputs" ]), 4 )
111+ _assert_eq (cwl_properties ["inputs" ][0 ].position , 1 )
112+ _assert_eq (cwl_properties ["inputs" ][0 ].type , "int" )
113+ _assert_eq (cwl_properties ["inputs" ][0 ].prefix .prefix , "--size" )
114+
115+ _assert_eq (cwl_properties ["inputs" ][1 ].position , 2 )
116+ _assert_eq (cwl_properties ["inputs" ][1 ].type , "File" )
117+ _assert_eq (cwl_properties ["inputs" ][1 ].prefix .prefix , "-i" )
118+
119+ _assert_eq (cwl_properties ["inputs" ][2 ].position , 3 )
120+ _assert_eq (cwl_properties ["inputs" ][2 ].type , "float" )
121+ _assert_eq (cwl_properties ["inputs" ][2 ].prefix .prefix , "--threshold" )
122+
123+ _assert_eq (cwl_properties ["inputs" ][3 ].position , 4 )
124+ _assert_eq (cwl_properties ["inputs" ][3 ].type , "string" )
125+ _assert_eq (cwl_properties ["inputs" ][3 ].prefix .prefix , "--output_type" )
126+
127+ _assert_eq (cwl_properties ["outputs" ][0 ].glob , "out" )
128+ _assert_eq (cwl_properties ["stdout" ], "out" )
129+
130+
94131def _example (example_command , example_outputs = [], example_inputs = []):
95132 """Build a CommandIO object for test cases."""
96133 kwds = {}
0 commit comments