Test tool shed version as well

This commit is contained in:
mvdbeek
2023-11-16 05:52:30 -05:00
committed by John Chilton
parent c3dc92b463
commit ca5fce7566
2 changed files with 50 additions and 2 deletions
+16 -2
View File
@@ -34,15 +34,28 @@ class UsesShedApi:
)
def repository_operation(
self, operation: OperationT, owner: str, name: str, changeset: str, tool_shed_url: str = DEFAULT_TOOL_SHED_URL
self,
operation: OperationT,
owner: str,
name: str,
changeset: str,
tool_shed_url: str = DEFAULT_TOOL_SHED_URL,
tool_panel_section_id: Optional[str] = None,
) -> Dict[str, Any]:
payload = {"tool_shed_url": tool_shed_url, "name": name, "owner": owner, "changeset_revision": changeset}
if tool_panel_section_id:
payload["tool_panel_section_id"] = tool_panel_section_id
create_response = operation(payload)
assert_status_code_is(create_response, 200)
return create_response.json()
def install_repository(
self, owner: str, name: str, changeset: str, tool_shed_url: str = DEFAULT_TOOL_SHED_URL
self,
owner: str,
name: str,
changeset: str,
tool_shed_url: str = DEFAULT_TOOL_SHED_URL,
tool_panel_section_id: Optional[str] = None,
) -> Dict[str, Any]:
try:
return self.repository_operation(
@@ -51,6 +64,7 @@ class UsesShedApi:
name=name,
changeset=changeset,
tool_shed_url=tool_shed_url,
tool_panel_section_id=tool_panel_section_id,
)
except AssertionError as e:
if "Error attempting to retrieve installation information from tool shed" in unicodify(e):
+34
View File
@@ -1,6 +1,8 @@
import os
import time
from galaxy_test.driver import integration_util
from galaxy_test.driver.uses_shed import UsesShed
THIS_DIR = os.path.dirname(__file__)
PANEL_VIEWS_DIR_1 = os.path.join(THIS_DIR, "panel_views_1")
@@ -123,6 +125,38 @@ class TestPanelViewsFromDirectoryIntegration(integration_util.IntegrationTestCas
assert tools[0]["version"] == "0.2"
class TestPanelViewsWithShedTools(integration_util.IntegrationTestCase, UsesShed):
framework_tool_and_types = True
allow_tool_conf_override = False
@classmethod
def handle_galaxy_config_kwds(cls, config):
super().handle_galaxy_config_kwds(config)
config["panel_views_dir"] = PANEL_VIEWS_DIR_1
def test_only_latest_version_in_panel_fastp(self):
FASTP_REPO = {"name": "fastp", "owner": "iuc", "tool_panel_section_id": "test_section_multi"}
OLD_CHANGESET = "1d8fe9bc4cb0"
NEW_CHANGESET = "dbf9c561ef29"
self.install_repository(**FASTP_REPO, changeset=OLD_CHANGESET)
self.install_repository(**FASTP_REPO, changeset=NEW_CHANGESET)
# give the toolbox a moment to reload after repo installation
time.sleep(5)
index = self.galaxy_interactor.get("tools", data=dict(in_panel=True, view="custom_13"))
index.raise_for_status()
index_as_list = index.json()
sections = [x for x in index_as_list if x["model_class"] == "ToolSection"]
assert len(sections) == 1
section = sections[0]
assert section["id"] == "test_section_multi"
tools = section["elems"]
assert len(tools) == 2, len(tools)
fastp = tools[0]
assert fastp["id"] == "toolshed.g2.bx.psu.edu/repos/iuc/fastp/fastp/0.20.1+galaxy0"
assert fastp["tool_shed_repository"]["changeset_revision"] == NEW_CHANGESET
class TestPanelViewsFromConfigIntegration(integration_util.IntegrationTestCase):
framework_tool_and_types = True