Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/release_23.0' into release_23.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed Jul 28, 2023
2 parents 512632c + d9b3ede commit e5d97e2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/tool_util/linters/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ERROR_ID_MSG = "Tool does not define an id attribute."
VALID_ID_MSG = "Tool defines an id [%s]."

PROFILE_PATTERN = re.compile(r"^[1,2]\d\.[0,1]\d$")
PROFILE_PATTERN = re.compile(r"^[12]\d\.\d{1,2}$")
PROFILE_INFO_DEFAULT_MSG = "Tool targets 16.01 Galaxy profile."
PROFILE_INFO_SPECIFIED_MSG = "Tool specifies profile version [%s]."
PROFILE_INVALID_MSG = "Tool specifies an invalid profile version [%s]."
Expand Down
4 changes: 1 addition & 3 deletions lib/galaxy/tool_util/verify/interactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,7 @@ def test_data_download(self, tool_id, filename, mode="file", is_output=True, too

if self.supports_test_data_download:
version_fragment = f"&tool_version={tool_version}" if tool_version else ""
response = self._get(
f"tools/{tool_id}/test_data_download?filename={filename}{version_fragment}", admin=True
)
response = self._get(f"tools/{tool_id}/test_data_download?filename={filename}{version_fragment}")
if response.status_code == 200:
if mode == "file":
result = response.content
Expand Down
18 changes: 18 additions & 0 deletions test/unit/tool_util/test_tool_linters.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@
</tool>
"""

GENERAL_VALID_NEW_PROFILE_FMT = """
<tool name="valid name" id="valid_id" version="1.0+galaxy1" profile="23.0">
</tool>
"""

# test tool xml for help linter
HELP_MULTIPLE = """
<tool>
Expand Down Expand Up @@ -1039,6 +1044,19 @@ def test_general_valid(lint_ctx):
assert not lint_ctx.error_messages


def test_general_valid_new_profile_fmt(lint_ctx):
tool_source = get_xml_tool_source(GENERAL_VALID_NEW_PROFILE_FMT)
run_lint(lint_ctx, general.lint_general, XmlToolSource(tool_source))
assert "Tool defines a version [1.0+galaxy1]." in lint_ctx.valid_messages
assert "Tool specifies profile version [23.0]." in lint_ctx.valid_messages
assert "Tool defines an id [valid_id]." in lint_ctx.valid_messages
assert "Tool defines a name [valid name]." in lint_ctx.valid_messages
assert not lint_ctx.info_messages
assert len(lint_ctx.valid_messages) == 4
assert not lint_ctx.warn_messages
assert not lint_ctx.error_messages


def test_help_multiple(lint_ctx):
tool_xml_tree = get_xml_tree(HELP_MULTIPLE)
run_lint(lint_ctx, help.lint_help, tool_xml_tree)
Expand Down

0 comments on commit e5d97e2

Please sign in to comment.