mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Restructure unit tests for tool_util package
This replaces a previous (now closed) PR: https://github.com/galaxyproject/galaxy/pull/8279 A few changes: - tests for code in galaxy/tool_util moved under test/unit/tool_util - common parts (used in both tools and tool_util) factored out into unittest_utils/sample_data.py - symlink to sample_data.py in test/unit/tool_util/ is needed to make the tool_util package tests run. This is not an ideal solution, but it avoids duplication of the sample data used by tests in tools/ and tool_util/.
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
../../../test/unit/unittest_utils/sample_data.py
|
||||
@@ -1 +1 @@
|
||||
../../../test/unit/tools/test_conda_resolution.py
|
||||
../../../test/unit/tool_util/test_conda_resolution.py
|
||||
@@ -1 +1 @@
|
||||
../../../test/unit/tools/test_output_checker.py
|
||||
../../../test/unit/tool_util/test_output_checker.py
|
||||
@@ -1 +1 @@
|
||||
../../../test/unit/tools/test_parsing.py
|
||||
../../../test/unit/tool_util/test_parsing.py
|
||||
@@ -1 +1 @@
|
||||
../../../test/unit/tools/test_tool_deps.py
|
||||
../../../test/unit/tool_util/test_tool_deps.py
|
||||
@@ -1 +1 @@
|
||||
../../../test/unit/tools/test_tool_loader.py
|
||||
../../../test/unit/tool_util/test_tool_loader.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../test/unit/tool_util/test_util.py
|
||||
@@ -1 +1 @@
|
||||
../../../test/unit/tools/util.py
|
||||
../../../test/unit/tool_util/util.py
|
||||
+1
@@ -0,0 +1 @@
|
||||
../unittest_utils/sample_data.py
|
||||
@@ -1,27 +1,10 @@
|
||||
import os
|
||||
from shutil import rmtree
|
||||
from string import Template
|
||||
from tempfile import mkdtemp
|
||||
|
||||
from galaxy.tool_util.loader import load_tool, template_macro_params
|
||||
from galaxy.util import parse_xml
|
||||
|
||||
|
||||
SIMPLE_TOOL_WITH_MACRO = """<tool id="tool_with_macro" name="macro_annotation" version="@WRAPPER_VERSION@">
|
||||
<expand macro="inputs" />
|
||||
<macros>
|
||||
<import>external.xml</import>
|
||||
</macros>
|
||||
</tool>"""
|
||||
|
||||
SIMPLE_MACRO = Template("""
|
||||
<macros>
|
||||
<token name="@WRAPPER_VERSION@">$tool_version</token>
|
||||
<macro name="inputs">
|
||||
<inputs/>
|
||||
</macro>
|
||||
</macros>
|
||||
""")
|
||||
from .sample_data import SIMPLE_TOOL_WITH_MACRO, SIMPLE_MACRO
|
||||
|
||||
|
||||
def test_loader():
|
||||
@@ -14,12 +14,9 @@ from galaxy.model import tool_shed_install
|
||||
from galaxy.model.tool_shed_install import mapping
|
||||
from galaxy.tools import ToolBox
|
||||
from galaxy.tools.cache import ToolCache
|
||||
from .test_tool_loader import (
|
||||
SIMPLE_MACRO,
|
||||
SIMPLE_TOOL_WITH_MACRO
|
||||
)
|
||||
from .test_toolbox_filters import mock_trans
|
||||
from ..tools_support import UsesApp, UsesTools
|
||||
from ..unittest_utils.sample_data import SIMPLE_TOOL_WITH_MACRO, SIMPLE_MACRO
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from string import Template
|
||||
|
||||
SIMPLE_TOOL_WITH_MACRO = """<tool id="tool_with_macro" name="macro_annotation" version="@WRAPPER_VERSION@">
|
||||
<expand macro="inputs" />
|
||||
<macros>
|
||||
<import>external.xml</import>
|
||||
</macros>
|
||||
</tool>"""
|
||||
|
||||
SIMPLE_MACRO = Template("""
|
||||
<macros>
|
||||
<token name="@WRAPPER_VERSION@">$tool_version</token>
|
||||
<macro name="inputs">
|
||||
<inputs/>
|
||||
</macro>
|
||||
</macros>
|
||||
""")
|
||||
Reference in New Issue
Block a user