Exemple #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')
Exemple #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"
Exemple #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')
Exemple #4
0
def test_command_get_arg_after_longopt():
    set_sysargv(test_command_3)
    c = Command()
    assert c.get_arg_after('--long') == "lastpos"
Exemple #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"
Exemple #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"
Exemple #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')
Exemple #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"
Exemple #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"