コード例 #1
0
def test_ToolInput_get_formatted_inputs():
    """Test :func:`planemo.training.tool_input.ToolInput.get_formatted_inputs`."""
    # test no input
    tool_input = ToolInput(tool_inp_desc=tool_inp_desc[1]["inputs"][0],
                           wf_param_values={},
                           wf_steps=wf_steps,
                           level=1,
                           should_be_there=False,
                           force_default=False)
    inputlist = tool_input.get_formatted_inputs()
    assert inputlist == ''
    # test collection
    tool_input = ToolInput(tool_inp_desc=tool_inp_desc[1]["inputs"][0],
                           wf_param_values=wf_param_values["add_to_database"],
                           wf_steps=wf_steps,
                           level=1,
                           should_be_there=False,
                           force_default=False)
    inputlist = tool_input.get_formatted_inputs()
    assert 'param-collection' in inputlist
    assert '(Input dataset collection)' in inputlist
    # test single input
    tool_input = ToolInput(tool_inp_desc=tool_inp_desc[2]["inputs"][0],
                           wf_param_values=wf_param_values["tables"][0],
                           wf_steps=wf_steps,
                           level=1,
                           should_be_there=False,
                           force_default=False)
    inputlist = tool_input.get_formatted_inputs()
    assert 'param-file' in inputlist
    assert '(Input dataset)' in inputlist
コード例 #2
0
def test_ToolInput_get_formatted_inputs():
    """Test :func:`planemo.training.tool_input.ToolInput.get_formatted_inputs`."""
    # test no input
    tool_input = ToolInput(
        tool_inp_desc=tool_inp_desc[1]["inputs"][0],
        wf_param_values={},
        wf_steps=wf_steps,
        level=1,
        should_be_there=False,
        force_default=False)
    inputlist = tool_input.get_formatted_inputs()
    assert inputlist == ''
    # test collection
    tool_input = ToolInput(
        tool_inp_desc=tool_inp_desc[1]["inputs"][0],
        wf_param_values=wf_param_values["add_to_database"],
        wf_steps=wf_steps,
        level=1,
        should_be_there=False,
        force_default=False)
    inputlist = tool_input.get_formatted_inputs()
    assert 'param-collection' in inputlist
    assert '(Input dataset collection)' in inputlist
    # test single input
    tool_input = ToolInput(
        tool_inp_desc=tool_inp_desc[2]["inputs"][0],
        wf_param_values=wf_param_values["tables"][0],
        wf_steps=wf_steps,
        level=1,
        should_be_there=False,
        force_default=False)
    inputlist = tool_input.get_formatted_inputs()
    assert 'param-file' in inputlist
    assert '(Input dataset)' in inputlist
コード例 #3
0
def test_ToolInput_get_formatted_desc():
    """Test :func:`planemo.training.tool_input.ToolInput.get_formatted_desc`."""
    # test no param values
    tool_input = ToolInput(tool_inp_desc={
        'value': 10,
        'name': 't',
        'type': ''
    },
                           wf_param_values={},
                           wf_steps=wf_steps,
                           level=1,
                           should_be_there=False,
                           force_default=False)
    assert tool_input.get_formatted_desc() == ''
    # test data
    tool_input = ToolInput(tool_inp_desc=tool_inp_desc[2]["inputs"][0],
                           wf_param_values=wf_param_values["tables"][0],
                           wf_steps=wf_steps,
                           level=1,
                           should_be_there=False,
                           force_default=False)
    inputlist = tool_input.get_formatted_inputs()
    formatted_desc = tool_input.get_formatted_desc()
    assert inputlist == formatted_desc
    # test section
    tool_input = ToolInput(tool_inp_desc=tool_inp_desc[1],
                           wf_param_values=wf_param_values,
                           wf_steps=wf_steps,
                           level=1,
                           should_be_there=True,
                           force_default=False)
    section_paramlist = tool_input.get_formatted_section_desc()
    formatted_desc = tool_input.get_formatted_desc()
    assert section_paramlist == formatted_desc
    # test conditional
    tool_input = ToolInput(tool_inp_desc=tool_inp_desc[5],
                           wf_param_values=wf_param_values,
                           wf_steps=wf_steps,
                           level=1,
                           should_be_there=True,
                           force_default=False)
    conditional_paramlist = tool_input.get_formatted_conditional_desc()
    formatted_desc = tool_input.get_formatted_desc()
    assert conditional_paramlist == formatted_desc
    # test repeat
    tool_input = ToolInput(tool_inp_desc=tool_inp_desc[2],
                           wf_param_values=wf_param_values,
                           wf_steps=wf_steps,
                           level=1,
                           should_be_there=True,
                           force_default=False)
    repeat_desc = tool_input.get_formatted_repeat_desc()
    formatted_desc = tool_input.get_formatted_desc()
    assert repeat_desc == formatted_desc
    # test other
    tool_input = ToolInput(tool_inp_desc=tool_inp_desc[3],
                           wf_param_values=wf_param_values,
                           wf_steps=wf_steps,
                           level=1,
                           should_be_there=True,
                           force_default=False)
    param_desc = tool_input.get_formatted_other_param_desc()
    formatted_desc = tool_input.get_formatted_desc()
    assert param_desc == formatted_desc
コード例 #4
0
def test_ToolInput_get_formatted_desc():
    """Test :func:`planemo.training.tool_input.ToolInput.get_formatted_desc`."""
    # test no param values
    tool_input = ToolInput(
        tool_inp_desc={'value': 10, 'name': 't', 'type': ''},
        wf_param_values={},
        wf_steps=wf_steps,
        level=1,
        should_be_there=False,
        force_default=False)
    assert tool_input.get_formatted_desc() == ''
    # test data
    tool_input = ToolInput(
        tool_inp_desc=tool_inp_desc[2]["inputs"][0],
        wf_param_values=wf_param_values["tables"][0],
        wf_steps=wf_steps,
        level=1,
        should_be_there=False,
        force_default=False)
    inputlist = tool_input.get_formatted_inputs()
    formatted_desc = tool_input.get_formatted_desc()
    assert inputlist == formatted_desc
    # test section
    tool_input = ToolInput(
        tool_inp_desc=tool_inp_desc[1],
        wf_param_values=wf_param_values,
        wf_steps=wf_steps,
        level=1,
        should_be_there=True,
        force_default=False)
    section_paramlist = tool_input.get_formatted_section_desc()
    formatted_desc = tool_input.get_formatted_desc()
    assert section_paramlist == formatted_desc
    # test conditional
    tool_input = ToolInput(
        tool_inp_desc=tool_inp_desc[5],
        wf_param_values=wf_param_values,
        wf_steps=wf_steps,
        level=1,
        should_be_there=True,
        force_default=False)
    conditional_paramlist = tool_input.get_formatted_conditional_desc()
    formatted_desc = tool_input.get_formatted_desc()
    assert conditional_paramlist == formatted_desc
    # test repeat
    tool_input = ToolInput(
        tool_inp_desc=tool_inp_desc[2],
        wf_param_values=wf_param_values,
        wf_steps=wf_steps,
        level=1,
        should_be_there=True,
        force_default=False)
    repeat_desc = tool_input.get_formatted_repeat_desc()
    formatted_desc = tool_input.get_formatted_desc()
    assert repeat_desc == formatted_desc
    # test other
    tool_input = ToolInput(
        tool_inp_desc=tool_inp_desc[3],
        wf_param_values=wf_param_values,
        wf_steps=wf_steps,
        level=1,
        should_be_there=True,
        force_default=False)
    param_desc = tool_input.get_formatted_other_param_desc()
    formatted_desc = tool_input.get_formatted_desc()
    assert param_desc == formatted_desc