예제 #1
0
def test_select_one_of_two_modules():
    config = {
        'module': 'decisionengine.framework.taskmanager.tests.TwoSources',
        'name': 'Source2',
        'parameters': {}
    }
    _create_module_instance(config, Source)
예제 #2
0
def test_no_module():
    config = {
        'module': 'decisionengine.framework.taskmanager.tests.NoSource',
        'parameters': {}
    }
    with pytest.raises(RuntimeError,
                       match="Could not find a decision-engine 'Source'"):
        _create_module_instance(config, Source)
예제 #3
0
def test_too_many_modules():
    config = {
        'module': 'decisionengine.framework.taskmanager.tests.TwoSources',
        'parameters': {}
    }
    with pytest.raises(RuntimeError,
                       match="Found more than one decision-engine 'Source'"):
        _create_module_instance(config, Source)
def test_no_module():
    config = {"module": "decisionengine.framework.taskmanager.tests.NoSource", "parameters": {}}
    channelname = "test"
    with pytest.raises(RuntimeError, match="Could not find a decision-engine 'Source'"):
        _create_module_instance(config, Source, channelname)
def test_select_one_of_two_modules():
    config = {"module": "decisionengine.framework.taskmanager.tests.TwoSources", "name": "Source2", "parameters": {}}
    channelname = "test"
    _create_module_instance(config, Source, channelname)
def test_too_many_modules():
    config = {"module": "decisionengine.framework.taskmanager.tests.TwoSources", "parameters": {}}
    channelname = "test"
    with pytest.raises(RuntimeError, match="Found more than one decision-engine 'Source'"):
        _create_module_instance(config, Source, channelname)