Mercurial > repos > guerler > springsuite
comparison 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 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:d30785e31577 |
|---|---|
| 1 from cwltool import command_line_tool | |
| 2 from cwltool.utils import windows_default_container_id | |
| 3 from cwltool.context import RuntimeContext | |
| 4 | |
| 5 | |
| 6 # Test to check warning when default docker Container is used on Windows | |
| 7 def test_default_docker_warning(mocker): | |
| 8 mocker.patch("cwltool.command_line_tool.onWindows", return_value=True) | |
| 9 mocker.patch("cwltool.command_line_tool._logger") | |
| 10 | |
| 11 class TestCommandLineTool(command_line_tool.CommandLineTool): | |
| 12 def __init__(self, **kwargs): | |
| 13 self.requirements = [] | |
| 14 self.hints = [] | |
| 15 | |
| 16 def find_default_container(self, args, builder): | |
| 17 return windows_default_container_id | |
| 18 | |
| 19 tool = TestCommandLineTool() | |
| 20 tool.make_job_runner(RuntimeContext({ | |
| 21 "find_default_container": lambda x: "frolvlad/alpine-bash"})) | |
| 22 | |
| 23 command_line_tool._logger.warning.assert_called_with( | |
| 24 command_line_tool.DEFAULT_CONTAINER_MSG, | |
| 25 windows_default_container_id, | |
| 26 windows_default_container_id) |
