From 9a682d4373449d44856f38fd819b7878efa53da9 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Mon, 29 Jan 2024 14:14:14 +0000 Subject: [PATCH] Add assertion message --- lib/galaxy/tool_util/toolbox/base.py | 4 +++- lib/galaxy/util/__init__.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tool_util/toolbox/base.py b/lib/galaxy/tool_util/toolbox/base.py index 006fa8302a23..c2a2f1ee47b2 100644 --- a/lib/galaxy/tool_util/toolbox/base.py +++ b/lib/galaxy/tool_util/toolbox/base.py @@ -661,7 +661,9 @@ def _load_integrated_tool_panel_keys(self): section = ToolSection(elem) for section_elem in elem: section_id = section_elem.get("id") - assert section_id + assert ( + section_id + ), f"Element '{etree.tostring(section_elem, encoding='unicode')}' did not specify 'id' attribute" if section_elem.tag == "tool": section.elems.stub_tool(section_id) elif section_elem.tag == "workflow": diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py index 8d8b51f445c3..6c5403ff6d60 100644 --- a/lib/galaxy/util/__init__.py +++ b/lib/galaxy/util/__init__.py @@ -1028,7 +1028,7 @@ def parse_resource_parameters(resource_param_file): resource_definitions_root = resource_definitions.getroot() for parameter_elem in resource_definitions_root.findall("param"): name = parameter_elem.get("name") - resource_parameters[name] = etree.tostring(parameter_elem) + resource_parameters[name] = etree.tostring(parameter_elem, encoding="unicode") return resource_parameters