Skip to content

Commit c8a6896

Browse files
author
Anton Khodak
committed
Add test case for caching with no docker image in wf
1 parent 0917112 commit c8a6896

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

tests/test_examples.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -530,19 +530,20 @@ def test_print_dot(self):
530530
self.assertEquals(main(["--print-dot", get_data('tests/wf/revsort.cwl')]), 0)
531531

532532

533-
class TestJsConsole(unittest.TestCase):
533+
class TestCmdLine(unittest.TestCase):
534534
def get_main_stderr(self, new_args):
535-
cwltool_base = path.join(path.dirname(path.abspath(__name__)), "cwltool")
536-
537535
process = subprocess.Popen([
538-
sys.executable,
539-
"-m",
540-
"cwltool"
541-
] + new_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
536+
sys.executable,
537+
"-m",
538+
"cwltool"
539+
] + new_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
542540

543541
stdout, stderr = process.communicate()
544542
return process.returncode, stderr.decode()
545543

544+
545+
class TestJsConsole(TestCmdLine):
546+
546547
def test_js_console_cmd_line_tool(self):
547548
for test_file in ("js_output.cwl", "js_output_workflow.cwl"):
548549
error_code, output = self.get_main_stderr(["--js-console", "--no-container",
@@ -560,6 +561,15 @@ def test_no_js_console(self):
560561

561562
self.assertNotIn("[log] Log message", output)
562563
self.assertNotIn("[err] Error message", output)
563-
564+
565+
566+
class TestCache(TestCmdLine):
567+
def test_wf_without_container(self):
568+
test_file = "hello-workflow.cwl"
569+
error_code, output = self.get_main_stderr(["--cachedir", "cache",
570+
get_data("tests/wf/" + test_file), "--usermessage", "hello"])
571+
self.assertEquals(error_code, 0)
572+
573+
564574
if __name__ == '__main__':
565575
unittest.main()

0 commit comments

Comments
 (0)