Exemplo n.º 1
0
def test_command_get_arg_after_nonexistent_argument():
    set_sysargv(test_command_1)
    c = Command()
    with pytest.raises(MissingArgumentError):
        c.get_arg_after('--bogus')
Exemplo n.º 2
0
def test_command_get_arg_after_shortopt_multiword():
    set_sysargv(test_command_7)
    c = Command()
    assert c.get_arg_after('-m') == "initial commit"
Exemplo n.º 3
0
def test_command_get_arg_after_lastposition():
    set_sysargv(test_command_2)
    c = Command()
    with pytest.raises(IndexOutOfRangeError):
        c.get_arg_after('lastpos')
Exemplo n.º 4
0
def test_command_get_arg_after_longopt():
    set_sysargv(test_command_3)
    c = Command()
    assert c.get_arg_after('--long') == "lastpos"
Exemplo n.º 5
0
def test_command_get_arg_after_longopt_alternate():
    set_sysargv(test_command_5)
    c = Command()
    assert c.get_arg_after('--test-option') == "lastpos"
def test_command_get_arg_after_shortopt():
    set_sysargv(test_command_2)
    c = Command()
    assert c.get_arg_after('-s') == "lastpos"
Exemplo n.º 7
0
def test_command_get_arg_after_shortopt():
    set_sysargv(test_command_2)
    c = Command()
    assert c.get_arg_after('-s') == "lastpos"
def test_command_get_arg_after_with_empty_arglist():
    set_sysargv(test_command_empty_1)
    c = Command()
    with pytest.raises(MissingArgumentError):
        c.get_arg_after('--test')
def test_command_get_arg_after_subcmd():
    set_sysargv(test_command_10)
    c = Command()
    assert c.get_arg_after('subcmd') == "subsubcmd"
def test_command_get_arg_after_lastposition():
    set_sysargv(test_command_2)
    c = Command()
    with pytest.raises(IndexOutOfRangeError):
        c.get_arg_after('lastpos')
def test_command_get_arg_after_nonexistent_argument():
    set_sysargv(test_command_1)
    c = Command()
    with pytest.raises(MissingArgumentError):
        c.get_arg_after('--bogus')
def test_command_get_arg_after_shortopt_multiword():
    set_sysargv(test_command_7)
    c = Command()
    assert c.get_arg_after('-m') == "initial commit"
def test_command_get_arg_after_longopt_alternate():
    set_sysargv(test_command_5)
    c = Command()
    assert c.get_arg_after('--test-option') == "lastpos"
def test_command_get_arg_after_longopt():
    set_sysargv(test_command_3)
    c = Command()
    assert c.get_arg_after('--long') == "lastpos"
Exemplo n.º 15
0
def test_command_get_arg_after_with_empty_arglist():
    set_sysargv(test_command_empty_1)
    c = Command()
    with pytest.raises(MissingArgumentError):
        c.get_arg_after('--test')
Exemplo n.º 16
0
def test_command_get_arg_after_subcmd_alternate():
    set_sysargv(test_command_6)
    c = Command()
    assert c.get_arg_after('install') == "git-all"
Exemplo n.º 17
0
def test_command_get_arg_after_subcmd():
    set_sysargv(test_command_10)
    c = Command()
    assert c.get_arg_after('subcmd') == "subsubcmd"
def test_command_get_arg_after_subcmd_alternate():
    set_sysargv(test_command_6)
    c = Command()
    assert c.get_arg_after('install') == "git-all"