Files
galaxy/test/integration/test_dynamic_edam_loading.py
T
John Chilton ff6b9d61fb Parse edam operation and topic data from bio.tools if available.
Two sources for bio.tools data:
- Configurable directory from Github (https://github.com/bio-tools/content/).
- API requests to bio.tools web service (cachable).

Code is structured into a stand-alone package decouple from Galaxy for dealing with bio.tools data and APIs and then an adapt to Galaxy's config.
2021-09-07 14:29:38 -04:00

38 lines
1.2 KiB
Python

import os
from galaxy_test.base.populators import (
DatasetPopulator,
)
from galaxy_test.driver import integration_util
SCRIPT_DIRECTORY = os.path.abspath(os.path.dirname(__file__))
MOCK_BIOTOOLS_CONTENT = os.path.join(SCRIPT_DIRECTORY, "mock_biotools_content")
class DynamicEdamLoadingIntegrationTestCase(integration_util.IntegrationTestCase):
"""Test mapping over tools with extended metadata enabled."""
framework_tool_and_types = True
@classmethod
def handle_galaxy_config_kwds(cls, config):
config["biotools_content_directory"] = MOCK_BIOTOOLS_CONTENT
config["biotools_use_api"] = False
def setUp(self):
super().setUp()
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
def test_edam_properties(self):
result = self._get("tools/bibtex")
result.raise_for_status()
result_json = result.json()
assert "edam_operations" in result_json
assert "edam_topics" in result_json
edam_operations = result_json["edam_operations"]
edam_topics = result_json["edam_topics"]
assert len(edam_operations) == 4
assert "operation_3198" in edam_operations
assert len(edam_topics) == 1
assert "topic_0102" in edam_topics