Skip to content

Commit 2037975

Browse files
authored
Don't add item to command line if input is null (#787)
1 parent 1eb6bfe commit 2037975

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

cwltool/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def bind_input(self, schema, datum, lead_pos=None, tail_pos=None, discover_secon
179179

180180
if schema["type"] == "record":
181181
for f in schema["fields"]:
182-
if f["name"] in datum:
182+
if f["name"] in datum and datum[f["name"]] is not None:
183183
bindings.extend(self.bind_input(f, datum[f["name"]], lead_pos=lead_pos, tail_pos=f["name"], discover_secondaryFiles=discover_secondaryFiles))
184184
else:
185185
datum[f["name"]] = f.get("default")

tests/test_js_sandbox.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ class TestValueFrom(unittest.TestCase):
5151
def test_value_from_two_concatenated_expressions(self):
5252
f = get_windows_safe_factory()
5353
echo = f.make(get_data("tests/wf/vf-concat.cwl"))
54-
self.assertEqual(echo(), {u"out": u"a sting\n"})
54+
self.assertEqual(echo(file1={
55+
"class": "File",
56+
"location": get_data("tests/wf/whale.txt")}),
57+
{u"out": u"a string\n"})
5558

5659

5760
class ExecJsProcessTest(unittest.TestCase):

tests/wf/vf-concat.cwl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ requirements:
55

66
baseCommand: echo
77
inputs:
8-
- id: parameter
9-
type: string?
8+
file1:
9+
type: File?
1010
inputBinding:
11-
valueFrom: $("a ")$("sting")
11+
valueFrom: $("a ")$("string")
1212
outputs:
1313
out:
1414
type: string

0 commit comments

Comments
 (0)