File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ from __future__ import absolute_import
2
+ import unittest
3
+ from mock import mock
4
+ from cwltool .utils import windows_default_container_id
5
+ from cwltool .draft2tool import DEFAULT_CONTAINER_MSG , CommandLineTool
6
+
7
+
8
+ class TestDefaultDockerWarning (unittest .TestCase ):
9
+
10
+ # Test to check warning when default docker Container is used on Windows
11
+ @mock .patch ("cwltool.draft2tool.onWindows" ,return_value = True )
12
+ @mock .patch ("cwltool.draft2tool._logger" )
13
+ def test_default_docker_warning (self ,mock_logger ,mock_windows ):
14
+
15
+ class TestCommandLineTool (CommandLineTool ):
16
+ def __init__ (self , ** kwargs ):
17
+ self .requirements = []
18
+ self .hints = []
19
+
20
+ def find_default_container (args , builder ):
21
+ return windows_default_container_id
22
+
23
+ TestObject = TestCommandLineTool ()
24
+ TestObject .makeJobRunner ()
25
+ mock_logger .warning .assert_called_with (DEFAULT_CONTAINER_MSG % (windows_default_container_id , windows_default_container_id ))
You can’t perform that action at this time.
0 commit comments