|
12 | 12 |
|
13 | 13 | from galaxy.tool_util.lint import Linter |
14 | 14 | from galaxy.tool_util.parameters import validate_test_cases_for_tool_source |
15 | | -from galaxy.tool_util.verify.assertion_models import assertion_list |
| 15 | +from galaxy.tool_util.verify.assertion_models import assertion_list, relaxed_assertion_list |
| 16 | +from galaxy.tool_util.verify.parse import tag_structure_to_that_structure |
16 | 17 | from galaxy.util import asbool |
17 | 18 | from ._util import is_datasource |
18 | 19 |
|
@@ -149,16 +150,16 @@ def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"): |
149 | 150 | return |
150 | 151 | assert "tests" in raw_tests_dict |
151 | 152 | # This really only allows coercion from strings, the values themselves will still be validated |
152 | | - strict_validation = tool_source.language != "xml" |
| 153 | + assert_list_model = relaxed_assertion_list if tool_source.language == "xml" else assertion_list |
153 | 154 | for test_idx, test in enumerate(raw_tests_dict["tests"], start=1): |
154 | 155 | # TODO: validate command, command_version, element tests. What about children? |
155 | 156 | for output in test["outputs"]: |
156 | 157 | asserts_raw = output.get("attributes", {}).get("assert_list") or [] |
157 | | - to_yaml_assertions = [] |
| 158 | + processed_assertions = [] |
158 | 159 | for raw_assert in asserts_raw: |
159 | | - to_yaml_assertions.append({"that": raw_assert["tag"], **raw_assert.get("attributes", {})}) |
| 160 | + processed_assertions.append(tag_structure_to_that_structure(raw_assert)) |
160 | 161 | try: |
161 | | - assertion_list.model_validate(to_yaml_assertions, strict=strict_validation) |
| 162 | + assert_list_model.model_validate(processed_assertions) |
162 | 163 | except Exception as e: |
163 | 164 | error_str = _cleanup_pydantic_error(e) |
164 | 165 | lint_ctx.warn( |
|
0 commit comments