Merge pull request #5784 from jmchilton/1801_fix_unzip

[18.01] Fix model operation tools that produce standalone datasets.
This commit is contained in:
Dannon Baker
2018-03-27 08:33:14 -04:00
committed by GitHub
2 changed files with 12 additions and 1 deletions
@@ -69,5 +69,12 @@ class ModelOperationToolAction(DefaultToolAction):
def _produce_outputs(self, trans, tool, out_data, output_collections, incoming, history, tags):
tool.produce_outputs(trans, out_data, output_collections, incoming, history=history, tags=tags)
mapped_over_elements = output_collections.dataset_collection_elements
if mapped_over_elements:
for name, value in out_data.items():
if name in mapped_over_elements:
value.visible = False
mapped_over_elements[name].hda = value
trans.sa_session.add_all(out_data.values())
trans.sa_session.flush()
+5 -1
View File
@@ -168,7 +168,11 @@ class ToolsTestCase(api.ApiTestCase):
}
}
self.dataset_populator.wait_for_history(history_id, assert_ok=True)
self._run("__UNZIP_COLLECTION__", history_id, inputs, assert_ok=True)
response = self._run("__UNZIP_COLLECTION__", history_id, inputs, assert_ok=True)
implicit_collections = response["implicit_collections"]
self.assertEquals(len(implicit_collections), 2)
unzipped_hdca = self.dataset_populator.get_history_collection_details(history_id, hid=implicit_collections[0]["hid"])
assert unzipped_hdca["elements"][0]["element_type"] == "hda", unzipped_hdca
def test_zip_inputs(self):
with self.dataset_populator.test_history() as history_id: