Skip to content

Commit d2889d2

Browse files
committed
fix test_trs.py for recent schema-salad release
1 parent 281e81a commit d2889d2

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

cwltool/provenance_profile.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@
4545
WFPROV,
4646
)
4747
from .stdfsaccess import StdFsAccess
48-
from .utils import (
49-
CWLObjectType,
50-
JobsType,
51-
get_listing,
52-
posix_path,
53-
versionstring,
54-
)
48+
from .utils import CWLObjectType, JobsType, get_listing, posix_path, versionstring
5549
from .workflow_job import WorkflowJob
5650

5751
if TYPE_CHECKING:

tests/test_trs.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from unittest import mock
33
from unittest.mock import MagicMock
44

5+
from cwltool.loghandler import _logger
56
from cwltool.main import main
67

78
from .util import get_data
@@ -21,8 +22,7 @@ def json(self) -> Any:
2122
return self.json_data
2223

2324

24-
def mocked_requests_head(*args: Any) -> MockResponse1:
25-
25+
def mocked_requests_head(*args: Any, **kwargs: Any) -> MockResponse1:
2626
return MockResponse1(None, 200)
2727

2828

@@ -87,14 +87,18 @@ def mocked_requests_get(*args: Any, **kwargs: Any) -> MockResponse2:
8787
200,
8888
)
8989

90-
print("A mocked call to TRS missed, target was %s", args[0])
90+
_logger.debug("A mocked call to TRS missed, target was %s", args[0])
9191
return MockResponse2(None, 404)
9292

9393

9494
@mock.patch("requests.Session.head", side_effect=mocked_requests_head)
9595
@mock.patch("requests.Session.get", side_effect=mocked_requests_get)
9696
def test_tool_trs_template(mock_head: MagicMock, mock_get: MagicMock) -> None:
97-
params = ["--make-template", r"quay.io/briandoconnor/dockstore-tool-md5sum:1.0.4"]
97+
params = [
98+
"--debug",
99+
"--make-template",
100+
r"quay.io/briandoconnor/dockstore-tool-md5sum:1.0.4",
101+
]
98102
return_value = main(params)
99103
mock_head.assert_called()
100104
mock_get.assert_called()
@@ -105,6 +109,7 @@ def test_tool_trs_template(mock_head: MagicMock, mock_get: MagicMock) -> None:
105109
@mock.patch("requests.Session.get", side_effect=mocked_requests_get)
106110
def test_workflow_trs_template(mock_head: MagicMock, mock_get: MagicMock) -> None:
107111
params = [
112+
"--debug",
108113
"--make-template",
109114
r"#workflow/github.com/dockstore-testing/md5sum-checker:develop",
110115
]

0 commit comments

Comments
 (0)