77
88from io import StringIO
99
10+ from cwltool .utils import onWindows
11+
1012try :
1113 reload
1214except :
@@ -530,19 +532,20 @@ def test_print_dot(self):
530532 self .assertEquals (main (["--print-dot" , get_data ('tests/wf/revsort.cwl' )]), 0 )
531533
532534
533- class TestJsConsole (unittest .TestCase ):
535+ class TestCmdLine (unittest .TestCase ):
534536 def get_main_stderr (self , new_args ):
535- cwltool_base = path .join (path .dirname (path .abspath (__name__ )), "cwltool" )
536-
537537 process = subprocess .Popen ([
538- sys .executable ,
539- "-m" ,
540- "cwltool"
541- ] + new_args , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
538+ sys .executable ,
539+ "-m" ,
540+ "cwltool"
541+ ] + new_args , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
542542
543543 stdout , stderr = process .communicate ()
544544 return process .returncode , stderr .decode ()
545545
546+
547+ class TestJsConsole (TestCmdLine ):
548+
546549 def test_js_console_cmd_line_tool (self ):
547550 for test_file in ("js_output.cwl" , "js_output_workflow.cwl" ):
548551 error_code , output = self .get_main_stderr (["--js-console" , "--no-container" ,
@@ -555,11 +558,24 @@ def test_js_console_cmd_line_tool(self):
555558
556559 def test_no_js_console (self ):
557560 for test_file in ("js_output.cwl" , "js_output_workflow.cwl" ):
558- error_code , output = self .get_main_stderr (["--no-container" ,
561+ error_code , output = self .get_main_stderr (["--no-container" ,
559562 get_data ("tests/wf/" + test_file )])
560563
561564 self .assertNotIn ("[log] Log message" , output )
562565 self .assertNotIn ("[err] Error message" , output )
563-
566+
567+
568+ @pytest .mark .skipif (onWindows (),
569+ reason = "Instance of cwltool is used, on Windows it invokes a default docker container"
570+ "which is not supported on AppVeyor" )
571+ class TestCache (TestCmdLine ):
572+ def test_wf_without_container (self ):
573+ test_file = "hello-workflow.cwl"
574+ error_code , output = self .get_main_stderr (["--cachedir" , "cache" ,
575+ get_data ("tests/wf/" + test_file ), "--usermessage" , "hello" ])
576+ self .assertIn ("completed success" , output )
577+ self .assertEquals (error_code , 0 )
578+
579+
564580if __name__ == '__main__' :
565581 unittest .main ()
0 commit comments