コード例 #1
0
ファイル: test_toolargparse.py プロジェクト: leipzig/cwltool
def test_argparser_without_doc() -> None:
    """The `desription` field is None if `doc` field is not provided."""
    loadingContext = LoadingContext()
    tool = load_tool(get_data("tests/without_doc.cwl"), loadingContext)
    p = argparse.ArgumentParser()
    parser = generate_parser(p, tool, {}, [], False)
    assert parser.description is None
コード例 #2
0
def test_argparse_append_with_default(
    job_order: List[str], expected_values: List[str]
) -> None:
    """The appended arguments must not include the default. But if no appended argument, then the default is used."""
    loadingContext = LoadingContext()
    tool = load_tool(get_data("tests/default_values_list.cwl"), loadingContext)
    toolparser = generate_parser(
        argparse.ArgumentParser(prog="test"), tool, {}, [], False
    )
    cmd_line = vars(toolparser.parse_args(job_order))
    file_paths = list(cmd_line["file_paths"])
    assert expected_values == file_paths