Skip to content

Commit

Permalink
Fix #18554.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Aug 3, 2024
1 parent c3195cf commit a6f9176
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/galaxy/tool_util/parser/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def parse_provided_metadata_file(self):

return provided_metadata_file

def parse_outputs(self, tool):
def parse_outputs(self, tool=None):
out_elem = self.root.find("outputs")
outputs = {}
output_collections = {}
Expand Down Expand Up @@ -558,7 +558,12 @@ def _parse_output(
# This ensures that old tools continue to work.
output.from_work_dir = output.from_work_dir.strip()
output.hidden = string_as_bool(data_elem.get("hidden", ""))
output.actions = ToolOutputActionGroup(output, data_elem.find("actions"))
if tool is not None:
# poor design here driven entirely by pragmatism in refactoring, ToolOutputActionGroup
# belongs in galaxy-tool because it uses app heavily. Breaking the output objects
# into app-aware things and dumb models would be a large project but superior design
# and decomposition.
output.actions = ToolOutputActionGroup(output, data_elem.find("actions"))
output.dataset_collector_descriptions = dataset_collector_descriptions_from_elem(
data_elem, legacy=self.legacy_defaults
)
Expand Down
8 changes: 8 additions & 0 deletions test/unit/tool_util/test_output_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from galaxy.tool_util.parser.factory import get_tool_source
from galaxy.tool_util.unittest_utils import functional_test_tool_path
from galaxy.tool_util.parser.output_models import from_tool_source


def test_from_tool_data_table():
tool_source = get_tool_source(functional_test_tool_path("dbkey_output_action.xml"))
output_models = from_tool_source(tool_source)

0 comments on commit a6f9176

Please sign in to comment.