mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
Merge pull request #6538 from jmchilton/tool_output_io
[18.01] Fix to_dict with io_details=True for tools with collection outputs.
This commit is contained in:
@@ -12,6 +12,9 @@ class ToolOutputBase(Dictifiable, object):
|
||||
self.hidden = hidden
|
||||
self.collection = False
|
||||
|
||||
def to_dict(self, view='collection', value_mapper=None, app=None):
|
||||
return super(ToolOutputBase, self).to_dict(view=view, value_mapper=value_mapper)
|
||||
|
||||
|
||||
class ToolOutput(ToolOutputBase):
|
||||
"""
|
||||
@@ -57,7 +60,7 @@ class ToolOutput(ToolOutputBase):
|
||||
return iter((self.format, self.metadata_source, self.parent))
|
||||
|
||||
def to_dict(self, view='collection', value_mapper=None, app=None):
|
||||
as_dict = super(ToolOutput, self).to_dict(view=view, value_mapper=value_mapper)
|
||||
as_dict = super(ToolOutput, self).to_dict(view=view, value_mapper=value_mapper, app=app)
|
||||
format = self.format
|
||||
if format and format != "input" and app:
|
||||
edam_format = app.datatypes_registry.edam_formats.get(self.format)
|
||||
@@ -83,6 +86,8 @@ class ToolOutputCollection(ToolOutputBase):
|
||||
<outputs>
|
||||
"""
|
||||
|
||||
dict_collection_visible_keys = ['name', 'default_format', 'label', 'hidden', 'inherit_format', 'inherit_metadata']
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
name,
|
||||
|
||||
@@ -79,6 +79,16 @@ class ToolsTestCase(api.ApiTestCase):
|
||||
assert f2_info["min"] is None
|
||||
assert f2_info["max"] is None
|
||||
|
||||
@skip_without_tool("collection_creates_list")
|
||||
def test_show_output_collection(self):
|
||||
tool_info = self._show_valid_tool("collection_creates_list")
|
||||
|
||||
outputs = tool_info["outputs"]
|
||||
assert len(outputs) == 1
|
||||
output = outputs[0]
|
||||
assert output["label"] == "Duplicate List"
|
||||
assert output["inherit_format"] is True
|
||||
|
||||
@skip_without_tool("test_data_source")
|
||||
def test_data_source_ok_request(self):
|
||||
with self.dataset_populator.test_history() as history_id:
|
||||
|
||||
Reference in New Issue
Block a user