diff planemo/lib/python3.7/site-packages/cwltool/tests/test_docker_warning.py @ 0:d30785e31577 draft

"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
author guerler
date Fri, 31 Jul 2020 00:18:57 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/planemo/lib/python3.7/site-packages/cwltool/tests/test_docker_warning.py	Fri Jul 31 00:18:57 2020 -0400
@@ -0,0 +1,26 @@
+from cwltool import command_line_tool
+from cwltool.utils import windows_default_container_id
+from cwltool.context import RuntimeContext
+
+
+# Test to check warning when default docker Container is used on Windows
+def test_default_docker_warning(mocker):
+    mocker.patch("cwltool.command_line_tool.onWindows", return_value=True)
+    mocker.patch("cwltool.command_line_tool._logger")
+
+    class TestCommandLineTool(command_line_tool.CommandLineTool):
+        def __init__(self, **kwargs):
+            self.requirements = []
+            self.hints = []
+
+        def find_default_container(self, args, builder):
+            return windows_default_container_id
+
+    tool = TestCommandLineTool()
+    tool.make_job_runner(RuntimeContext({
+        "find_default_container": lambda x: "frolvlad/alpine-bash"}))
+
+    command_line_tool._logger.warning.assert_called_with(
+        command_line_tool.DEFAULT_CONTAINER_MSG,
+        windows_default_container_id,
+        windows_default_container_id)