Files
galaxy/test/unit/workflows/test_modules.py
T
John Chilton 4dcfe4c561 Some very basic unit tests and docs for workflow modules.
Just a start - I need to keep going with this and test and document all methods.
2014-08-26 10:02:49 -04:00

40 lines
1.0 KiB
Python

from galaxy import eggs
eggs.require( "mock" )
import mock
from galaxy.workflow import modules
from .workflow_support import MockTrans
def test_input_has_no_errors():
trans = MockTrans()
input_step_module = modules.module_factory.new( trans, 'data_input' )
assert not input_step_module.get_errors()
def test_valid_new_tool_has_no_errors():
trans = MockTrans()
mock_tool = mock.Mock()
trans.app.toolbox.tools[ "cat1" ] = mock_tool
tool_module = modules.module_factory.new( trans, 'tool', tool_id="cat1" )
assert not tool_module.get_errors()
def test_missing_tool_has_errors():
trans = MockTrans()
tool_dict = { "type": "tool", "tool_id": "cat1" }
tool_module = modules.module_factory.from_dict( trans, tool_dict )
assert tool_module.get_errors()
def test_cannot_create_tool_modules_for_missing_tools():
trans = MockTrans()
exception = False
try:
modules.module_factory.new( trans, 'tool', tool_id="cat1" )
except Exception:
exception = True
assert exception