From 4ad4688fdec15a45f0df98aa03f17a4e098cd877 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 15 Apr 2015 15:49:28 -0400 Subject: [PATCH] Fix label's on output collections. Thanks to @kellrott for reporting the issue. https://trello.com/c/Qc2A4rsw --- lib/galaxy/tools/parser/xml.py | 2 ++ test/api/test_tools.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/tools/parser/xml.py b/lib/galaxy/tools/parser/xml.py index 180b76db90b..66be0ff435f 100644 --- a/lib/galaxy/tools/parser/xml.py +++ b/lib/galaxy/tools/parser/xml.py @@ -158,6 +158,7 @@ class XmlToolSource(ToolSource): for collection_elem in out_elem.findall("collection"): name = collection_elem.get( "name" ) + label = xml_text( collection_elem, "label" ) default_format = collection_elem.get( "format", "data" ) collection_type = collection_elem.get( "type", None ) structured_like = collection_elem.get( "structured_like", None ) @@ -180,6 +181,7 @@ class XmlToolSource(ToolSource): output_collection = galaxy.tools.ToolOutputCollection( name, structure, + label=label, default_format=default_format, inherit_format=inherit_format, inherit_metadata=inherit_metadata, diff --git a/test/api/test_tools.py b/test/api/test_tools.py index fe93e6cd436..e2469b71738 100644 --- a/test/api/test_tools.py +++ b/test/api/test_tools.py @@ -302,7 +302,7 @@ class ToolsTestCase( api.ApiTestCase ): self._assert_has_keys( output_collection, "id", "name", "elements", "populated" ) assert not output_collection[ "populated" ] assert len( output_collection[ "elements" ] ) == 0 - + self.assertEquals( output_collection[ "name" ], "Table split on first column" ) self.dataset_populator.wait_for_job( create["jobs"][0]["id"], assert_ok=True ) get_collection_response = self._get( "dataset_collections/%s" % output_collection[ "id" ], data={"instance_type": "history"} ) @@ -312,6 +312,8 @@ class ToolsTestCase( api.ApiTestCase ): self._assert_has_keys( output_collection, "id", "name", "elements", "populated" ) assert output_collection[ "populated" ] assert len( output_collection[ "elements" ] ) == 2 + self.assertEquals( output_collection[ "name" ], "Table split on first column" ) + # TODO: verify element identifiers @skip_without_tool( "cat1" )