Skip to content

Commit d47a5a6

Browse files
committed
add test for var_spool_cwl_detector()
1 parent 9ef9773 commit d47a5a6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

cwltool/factory.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def __init__(self,
5555

5656
def make(self, cwl):
5757
"""Instantiate a CWL object from a CWl document."""
58-
load = load_tool.load_tool(cwl, self.makeTool)
58+
load = load_tool.load_tool(cwl, self.makeTool,
59+
strict=self.execkwargs.get("strict", True))
5960
if isinstance(load, int):
6061
raise Exception("Error loading tool")
6162
return Callable(load, self)

tests/test_examples.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,13 @@ def test_checker(self):
556556
f = cwltool.factory.Factory()
557557
f.make("tests/checker_wf/broken-wf2.cwl")
558558

559+
def test_var_spool_cwl_checker(self):
560+
""" Confirm that references to /var/spool/cwl are caught."""
561+
with self.assertRaises(schema_salad.validate.ValidationException):
562+
f = cwltool.factory.Factory()
563+
f.make("tests/non_portable.cwl")
564+
f = cwltool.factory.Factory(strict=False)
565+
f.make("tests/non_portable.cwl")
559566

560567
class TestPrintDot(unittest.TestCase):
561568
def test_print_dot(self):

0 commit comments

Comments
 (0)