コード例 #1
0
def test_parse_arg_lists():
    docstring = """The tool

Usage:
    tool -o <out>...

Options:
    -o, --output <out>...   The list
"""
    args = cli.parse_args(docstring, ['-o', 'A', 'B'],
                          options_first=False)
    assert args['--output'] == ['A', 'B']
コード例 #2
0
def test_command_line_arguments_with_db():
    args = parse_args(jip.cli.jip_exec.__doc__, ["--db", "test.db", "123"],
                      options_first=True)

    assert args.get("--db", None) == "test.db"
    assert args.get("<id>", None) == "123"
コード例 #3
0
def test_command_line_arguments_with_db():
    args = parse_args(jip.cli.jip_exec.__doc__, ["--db", "test.db", "123"],
                      options_first=True)

    assert args.get("--db", None) == "test.db"
    assert args.get("<id>", None) == "123"