mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #8365 from ic4f/dev_unittests_refactor_tools
Remove some test interdependencies in unit/tools
This commit is contained in:
@@ -3,7 +3,7 @@ test_select_parameters.py.
|
||||
"""
|
||||
from galaxy import model
|
||||
from galaxy.util import bunch
|
||||
from .test_parameter_parsing import BaseParameterTestCase
|
||||
from .util import BaseParameterTestCase
|
||||
from ..tools_support import datatypes_registry
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from galaxy import model
|
||||
from .test_parameter_parsing import BaseParameterTestCase
|
||||
from .util import BaseParameterTestCase
|
||||
from ..unittest_utils import galaxy_mock
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
from unittest import TestCase
|
||||
from xml.etree.ElementTree import XML
|
||||
|
||||
from galaxy import model
|
||||
from galaxy.tools.parameters import basic
|
||||
from galaxy.tools.parameters.meta import process_key
|
||||
from galaxy.util import bunch
|
||||
from ..tools_support import UsesApp
|
||||
from .util import BaseParameterTestCase
|
||||
|
||||
|
||||
class ProcessKeyTestCase(TestCase):
|
||||
@@ -46,22 +42,6 @@ class ProcessKeyTestCase(TestCase):
|
||||
self.assertEqual(nested_dict, expected_dict)
|
||||
|
||||
|
||||
class BaseParameterTestCase(TestCase, UsesApp):
|
||||
|
||||
def setUp(self):
|
||||
self.setup_app()
|
||||
self.mock_tool = bunch.Bunch(
|
||||
app=self.app,
|
||||
tool_type="default",
|
||||
valid_input_states=model.Dataset.valid_input_states,
|
||||
)
|
||||
|
||||
def _parameter_for(self, **kwds):
|
||||
content = kwds["xml"]
|
||||
param_xml = XML(content)
|
||||
return basic.ToolParameter.build(self.mock_tool, param_xml)
|
||||
|
||||
|
||||
class ParameterParsingTestCase(BaseParameterTestCase):
|
||||
""" Test the parsing of XML for most parameter types - in many
|
||||
ways these are not very good tests since they break the abstraction
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from galaxy import model
|
||||
from galaxy.tools.parameters import basic
|
||||
from galaxy.util import bunch
|
||||
from .test_parameter_parsing import BaseParameterTestCase
|
||||
from .util import BaseParameterTestCase
|
||||
|
||||
|
||||
class SelectToolParameterTestCase(BaseParameterTestCase):
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
from unittest import TestCase
|
||||
from xml.etree.ElementTree import XML
|
||||
|
||||
from galaxy import model
|
||||
from galaxy.tools.parameters import basic
|
||||
from galaxy.util import bunch
|
||||
from ..tools_support import UsesApp
|
||||
|
||||
|
||||
class BaseParameterTestCase(TestCase, UsesApp):
|
||||
|
||||
def setUp(self):
|
||||
self.setup_app()
|
||||
self.mock_tool = bunch.Bunch(
|
||||
app=self.app,
|
||||
tool_type="default",
|
||||
valid_input_states=model.Dataset.valid_input_states,
|
||||
)
|
||||
|
||||
def _parameter_for(self, **kwds):
|
||||
content = kwds["xml"]
|
||||
param_xml = XML(content)
|
||||
return basic.ToolParameter.build(self.mock_tool, param_xml)
|
||||
Reference in New Issue
Block a user