Skip to content

Commit a85f8fd

Browse files
committed
fix --help on CWL descriptions
1 parent a46b620 commit a85f8fd

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

cwltool/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ def generate_parser(toolparser, tool, namemap):
255255
default = None # type: Any
256256

257257
if inptype == "File":
258-
action = cast(FileAction, argparse.Action)
258+
action = cast(argparse.Action, FileAction)
259259
elif isinstance(inptype, dict) and inptype["type"] == "array":
260260
if inptype["items"] == "File":
261-
action = cast(FileAppendAction, argparse.Action)
261+
action = cast(argparse.Action, FileAppendAction)
262262
else:
263263
action = "append"
264264

tests/test_toolargparse.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import unittest
2+
from tempfile import NamedTemporaryFile
3+
from cwltool.main import main
4+
5+
6+
class ToolArgparse(unittest.TestCase):
7+
8+
9+
script='''
10+
#!/usr/bin/env cwl-runner
11+
cwlVersion: "cwl:draft-3"
12+
class: CommandLineTool
13+
description: "This tool is developed for SMC-RNA Challenge for detecting gene fusions (STAR fusion)"
14+
inputs:
15+
#Give it a list of input files
16+
- id: input
17+
type: File
18+
inputBinding:
19+
position: 0
20+
outputs:
21+
- id: output
22+
type: File
23+
outputBinding:
24+
glob: test.txt
25+
stdout: test.txt
26+
baseCommand: [cat]
27+
'''
28+
29+
def test_help(self):
30+
with NamedTemporaryFile() as f:
31+
f.write(self.script)
32+
f.flush()
33+
self.assertEquals(main([f.name, '--input', 'README.rst']), 0)

0 commit comments

Comments
 (0)