示例#1
0
def test_get_wf_param_values():
    """Test :func:`planemo.training.tutorial.get_wf_param_values`."""
    wf_step = wf['steps']['4']
    wf_param_value_tests = get_wf_param_values(wf_step['tool_state'], get_wf_inputs(wf_step['input_connections']))
    assert isinstance(wf_param_value_tests, dict)
    for k in wf_param_values:
        assert k in wf_param_value_tests
def test_get_wf_inputs():
    """Test :func:`planemo.training.tutorial.get_wf_inputs`."""
    step_inp = {
        'tables_1|table': {
            'output_name': 'output',
            'id': 2
        },
        'add_to_database|withdb': {
            'output_name': 'output',
            'id': 0
        },
        'tables_0|table': {
            'output_name': 'output',
            'id': 1
        },
        'add_to_database|tab_0|tt': {
            'output_name': 'output',
            'id': 0
        },
        'tables_2|section|sect': {
            'output_name': 'output',
            'id': 1
        },
        'tables_3|tables_0|sect': {
            'output_name': 'output',
            'id': 1
        }
    }
    step_inputs = get_wf_inputs(step_inp)
    assert 'tables' in step_inputs
    assert '0' in step_inputs['tables']
    assert 'table' in step_inputs['tables']['0']
    assert '2' in step_inputs['tables']
    assert 'section' in step_inputs['tables']['2']
    assert 'sect' in step_inputs['tables']['2']['section']
    assert 'output_name' in step_inputs['tables']['2']['section']['sect']
    assert 'add_to_database' in step_inputs
    assert 'withdb' in step_inputs['add_to_database']
    assert 'tab' in step_inputs['add_to_database']
    assert '0' in step_inputs['add_to_database']['tab']
    assert 'tt' in step_inputs['add_to_database']['tab']['0']
def test_get_wf_inputs():
    """Test :func:`planemo.training.tutorial.get_wf_inputs`."""
    step_inp = {
        'tables_1|table': {'output_name': 'output', 'id': 2},
        'add_to_database|withdb': {'output_name': 'output', 'id': 0},
        'tables_0|table': {'output_name': 'output', 'id': 1},
        'add_to_database|tab_0|tt': {'output_name': 'output', 'id': 0},
        'tables_2|section|sect': {'output_name': 'output', 'id': 1},
        'tables_3|tables_0|sect': {'output_name': 'output', 'id': 1}
    }
    step_inputs = get_wf_inputs(step_inp)
    assert 'tables' in step_inputs
    assert '0' in step_inputs['tables']
    assert 'table' in step_inputs['tables']['0']
    assert '2' in step_inputs['tables']
    assert 'section' in step_inputs['tables']['2']
    assert 'sect' in step_inputs['tables']['2']['section']
    assert 'output_name' in step_inputs['tables']['2']['section']['sect']
    assert 'add_to_database' in step_inputs
    assert 'withdb' in step_inputs['add_to_database']
    assert 'tab' in step_inputs['add_to_database']
    assert '0' in step_inputs['add_to_database']['tab']
    assert 'tt' in step_inputs['add_to_database']['tab']['0']