Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.

Commit ff45acb

Browse files
committed
Update InlineJavascriptRequirement to not require expressionLib
1 parent 7a3f391 commit ff45acb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cwlgen/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,10 @@ def __init__(self, expression_lib=None):
338338
self.expressionLib = expression_lib
339339

340340
def _to_dict(self):
341-
return {'expressionLib': [self.expressionLib]}
341+
if self.expressionLib:
342+
return {'expressionLib': [self.expressionLib]}
343+
else:
344+
return {}
342345

343346

344347
class DockerRequirement(Requirement):

test/test_unit_workflow.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_generates_workflow_int_inputs(self):
8888

8989
def test_add_requirements(self):
9090
w = cwlgen.Workflow()
91-
req = cwlgen.InlineJavascriptReq(expression_lib='test_lib')
91+
req = cwlgen.InlineJavascriptReq()
9292
w.requirements.append(req)
9393
generated = self.capture_tempfile(w.export)
9494
expected = b"""#!/usr/bin/env cwl-runner
@@ -98,8 +98,7 @@ def test_add_requirements(self):
9898
inputs: {}
9999
outputs: {}
100100
requirements:
101-
InlineJavascriptRequirement:
102-
expressionLib: [test_lib]
101+
InlineJavascriptRequirement: {}
103102
"""
104103
self.assertEqual(expected, generated)
105104

0 commit comments

Comments
 (0)