def test_mdefinitions_get_multipledef_commandobj():
    set_sysargv(test_command_18)
    c = Command()
    assert c.get_multiple_definitions('o') == ['path1', 'path2']
    assert c.get_multiple_definitions('file') == ['tests/path1', 'tests/path2']
    with pytest.raises(MissingDictionaryKeyError):
        assert c.get_multiple_definitions('bogus')
示例#2
0
def test_mdefinitions_get_multipledef_commandobj():
    set_sysargv(test_command_18)
    c = Command()
    assert c.get_multiple_definitions('o') == ['path1', 'path2']
    assert c.get_multiple_definitions('file') == ['tests/path1', 'tests/path2']
    with pytest.raises(MissingDictionaryKeyError):
        assert c.get_multiple_definitions('bogus')
示例#3
0
def test_mdefinitions_contains_from_commandobj():
    set_sysargv(test_command_18)
    c = Command()
    assert c.contains_multi_definitions('o') == True
    assert c.contains_multi_definitions('file') == True
    assert c.contains_multi_definitions('o', 'file') == True
    assert c.contains_multi_definitions('bogus') == False
    assert c.contains_multi_definitions('o', 'bogus') == False
def test_mdefinitions_contains_from_commandobj():
    set_sysargv(test_command_18)
    c = Command()
    assert c.contains_multi_definitions('o') == True
    assert c.contains_multi_definitions('file') == True
    assert c.contains_multi_definitions('o', 'file') == True
    assert c.contains_multi_definitions('bogus') == False
    assert c.contains_multi_definitions('o', 'bogus') == False
def test_mdefinitions_contains_from_commandobj_empty():
    set_sysargv(test_command_empty_1)
    c = Command()
    assert c.contains_multi_definitions('bogus') == False
示例#6
0
def test_mdefinitions_commandobj():
    set_sysargv(test_command_13)
    c = Command()
    assert len(c.mdefs) == 1
    assert c.mdefs['o'] == ['path1', 'path2']
示例#7
0
def test_mdefinitions_commandobj_none():
    set_sysargv(test_command_1)
    c = Command()
    assert len(c.mdefs) == 0
示例#8
0
def test_mdefinitions_contains_from_commandobj_empty():
    set_sysargv(test_command_empty_1)
    c = Command()
    assert c.contains_multi_definitions('bogus') == False