mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-29 17:42:12 +08:00
Rebase into handling multiple versions.
This commit is contained in:
@@ -519,9 +519,13 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin):
|
||||
rval.append(lineage_tool)
|
||||
if not rval:
|
||||
# still no tool, do a deeper search and try to match by old ids
|
||||
for tool in self._tools_by_id.values():
|
||||
if tool.old_id == tool_id:
|
||||
rval.append(tool)
|
||||
if get_all_versions and tool_id in self._tool_versions_by_id:
|
||||
rval.extend(self._tool_versions_by_id[tool_id].values())
|
||||
else:
|
||||
for tool in self._tools_by_id.values():
|
||||
if tool.old_id == tool_id:
|
||||
rval.append(tool)
|
||||
|
||||
# if we don't have a lineage_map for this tool we need to sort by version,
|
||||
# so that the last tool in rval is the newest tool.
|
||||
rval.sort(key=lambda t: t.version)
|
||||
|
||||
@@ -690,11 +690,13 @@ class ToolsTestCase(ApiTestCase, TestsTools):
|
||||
@uses_test_history(require_new=False)
|
||||
def test_test_by_versions(self, history_id):
|
||||
test_data_response = self._get("tools/%s/test_data" % "multiple_versions")
|
||||
test_data_response.raise_for_status()
|
||||
test_data_dicts = test_data_response.json()
|
||||
assert len(test_data_dicts) == 1
|
||||
assert test_data_dicts[0]["tool_version"] == "0.2"
|
||||
|
||||
test_data_response = self._get("tools/%s/test_data?tool_version=*" % "multiple_versions")
|
||||
test_data_response.raise_for_status()
|
||||
test_data_dicts = test_data_response.json()
|
||||
assert len(test_data_dicts) == 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user