Fix ChangeDatatypeAction for collections

This commit is contained in:
mvdbeek
2019-03-08 16:59:05 +01:00
parent 199468e920
commit 377bffd3ae
2 changed files with 28 additions and 1 deletions
+2 -1
View File
@@ -77,7 +77,8 @@ class ChangeDatatypeAction(DefaultJobAction):
for dataset_collection_assoc in job.output_dataset_collection_instances:
if action.output_name == '' or dataset_collection_assoc.name == action.output_name:
for dataset_instance in dataset_collection_assoc.dataset_collection_instance.dataset_instances:
app.datatypes_registry.change_datatype(dataset_instance, action.action_arguments['newtype'])
if dataset_instance:
app.datatypes_registry.change_datatype(dataset_instance, action.action_arguments['newtype'])
@classmethod
def get_short_str(cls, pja):
+26
View File
@@ -1612,6 +1612,32 @@ input1:
""", history_id=history_id, wait=True)
self.assertEqual("0\n", self.dataset_populator.get_history_dataset_content(history_id))
@skip_without_tool("random_lines1")
def test_change_datatype_collection_map_over(self):
with self.dataset_populator.test_history() as history_id:
jobs_summary = self._run_jobs("""
class: GalaxyWorkflow
inputs:
text_input1: collection
steps:
map_over:
tool_id: random_lines1
in:
input: text_input1
outputs:
out_file1:
change_datatype: csv
""", test_data="""
text_input1:
type: "list:paired"
""", history_id=history_id)
hdca = self.dataset_populator.get_history_collection_details(history_id=jobs_summary.history_id, hid=4)
assert hdca['collection_type'] == 'list:paired'
assert len(hdca['elements'][0]['object']["elements"]) == 2
forward, reverse = hdca['elements'][0]['object']["elements"]
assert forward['object']['file_ext'] == 'csv'
assert reverse['object']['file_ext'] == 'csv'
@skip_without_tool("collection_type_source_map_over")
def test_mapping_and_subcollection_mapping(self):
with self.dataset_populator.test_history() as history_id: