Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
Tests the functionality of the Blend CloudMan API. These tests require working
credentials to supported cloud infrastructure.
"""
from . import GalaxyTestBase
class TestGalaxyToolData(GalaxyTestBase.GalaxyTestBase):
def test_get_data_tables(self):
tables = self.gi.tool_data.get_data_tables()
for table in tables:
self.assertIsNotNone(table['name'])
def test_show_data_table(self):
tables = self.gi.tool_data.get_data_tables()
table = self.gi.tool_data.show_data_table(tables[0]['name'])
self.assertIsNotNone(table['columns'])
self.assertIsNotNone(table['fields'])
self.assertIsNotNone(table['name'])
from bioblend.galaxy import dataset_collections
from . import GalaxyTestBase
class TestGalaxyDatasetCollections(GalaxyTestBase.GalaxyTestBase):
def test_create_list_in_history(self):
history_id = self.gi.histories.create_history(name="TestDSListCreate")["id"]
dataset1_id = self._test_dataset(history_id)
dataset2_id = self._test_dataset(history_id)
dataset3_id = self._test_dataset(history_id)
collection_response = self.gi.histories.create_dataset_collection(
history_id=history_id,
collection_description=dataset_collections.CollectionDescription(
name="MyDatasetList",
elements=[
dataset_collections.HistoryDatasetElement(name="sample1", id=dataset1_id),
dataset_collections.HistoryDatasetElement(name="sample2", id=dataset2_id),
dataset_collections.HistoryDatasetElement(name="sample3", id=dataset3_id),
]
)
import os
import time
from . import GalaxyTestBase, test_util
class TestGalaxyInvocations(GalaxyTestBase.GalaxyTestBase):
@test_util.skip_unless_galaxy('release_19.09')
def test_invocation(self):
path = test_util.get_abspath(os.path.join('data', 'paste_columns.ga'))
workflow = self.gi.workflows.import_workflow_from_local_path(path)
history_id = self.gi.histories.create_history(name="TestWorkflowState")["id"]
dataset1_id = self._test_dataset(history_id)
dataset = {'src': 'hda', 'id': dataset1_id}
invocation = self.gi.workflows.invoke_workflow(
workflow['id'],
inputs={'Input 1': dataset, 'Input 2': dataset},
history_id=history_id,
inputs_by='name',
)
invocation_id = invocation["id"]
import os
import shutil
import tempfile
from . import GalaxyTestBase, test_util
FOO_DATA = 'foo\nbar\n'
class TestGalaxyLibraries(GalaxyTestBase.GalaxyTestBase):
def setUp(self):
super().setUp()
self.name = 'automated test library'
self.library = self.gi.libraries.create_library(self.name, description='automated test', synopsis='automated test synopsis')
def tearDown(self):
self.gi.libraries.delete_library(self.library['id'])
def test_create_library(self):
self.assertEqual(self.library['name'], self.name)
self.assertIsNotNone(self.library['id'])
def test_get_libraries(self):
library_data = self.gi.libraries.get_libraries(library_id=self.library['id'])[0]
self.assertTrue(library_data['name'] == self.name)