Skip to content

Commit ecdfe1e

Browse files
bogdang989Peter Amstutz
authored andcommitted
Fix for argument with empty prefix and separate False (#1166)
Fix for argument with empty prefix and separate False
1 parent 46b7f97 commit ecdfe1e

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

cwltool/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def generate_arg(self, binding): # type: (Dict[Text, Any]) -> List[Text]
426426
if sep:
427427
args.extend([prefix, self.tostr(j)])
428428
else:
429-
args.append("" if not prefix else prefix + self.tostr(j))
429+
args.append(self.tostr(j) if prefix is None else prefix + self.tostr(j))
430430

431431
return [a for a in args if a is not None]
432432

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class: CommandLineTool
2+
cwlVersion: v1.0
3+
baseCommand: []
4+
inputs:
5+
echo: boolean
6+
outputs: []
7+
arguments:
8+
- position: 1
9+
shellQuote: false
10+
prefix: ''
11+
valueFrom: "non_existing_app"
12+
- position: 0
13+
prefix: ''
14+
separate: false
15+
shellQuote: false
16+
valueFrom: "echo"
17+
requirements:
18+
- class: ShellCommandRequirement

tests/test_examples.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,3 +1018,11 @@ def test_env_filtering(factor):
10181018
else:
10191019
target = 4
10201020
assert json.loads(stdout)['env_count'] == target, (error_code, stdout, stderr)
1021+
1022+
@windows_needs_docker
1023+
def test_v1_0_arg_empty_prefix_separate_false():
1024+
test_file = "tests/arg-empty-prefix-separate-false.cwl"
1025+
error_code, stdout, stderr = get_main_output(
1026+
['--debug', get_data(test_file), "--echo"])
1027+
assert "completed success" in stderr
1028+
assert error_code == 0

0 commit comments

Comments
 (0)