7
7
8
8
from io import StringIO
9
9
10
+ from cwltool .utils import onWindows
11
+
10
12
try :
11
13
reload
12
14
except :
@@ -530,19 +532,20 @@ def test_print_dot(self):
530
532
self .assertEquals (main (["--print-dot" , get_data ('tests/wf/revsort.cwl' )]), 0 )
531
533
532
534
533
- class TestJsConsole (unittest .TestCase ):
535
+ class TestCmdLine (unittest .TestCase ):
534
536
def get_main_stderr (self , new_args ):
535
- cwltool_base = path .join (path .dirname (path .abspath (__name__ )), "cwltool" )
536
-
537
537
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 )
542
542
543
543
stdout , stderr = process .communicate ()
544
544
return process .returncode , stderr .decode ()
545
545
546
+
547
+ class TestJsConsole (TestCmdLine ):
548
+
546
549
def test_js_console_cmd_line_tool (self ):
547
550
for test_file in ("js_output.cwl" , "js_output_workflow.cwl" ):
548
551
error_code , output = self .get_main_stderr (["--js-console" , "--no-container" ,
@@ -555,11 +558,24 @@ def test_js_console_cmd_line_tool(self):
555
558
556
559
def test_no_js_console (self ):
557
560
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" ,
559
562
get_data ("tests/wf/" + test_file )])
560
563
561
564
self .assertNotIn ("[log] Log message" , output )
562
565
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
+
564
580
if __name__ == '__main__' :
565
581
unittest .main ()
0 commit comments