示例#1
0
def desktop_file_validate(package_root, analysis):
    log = ""
    failed = False
    for dirpath, dirnames, filenames in os.walk(package_root):
        for fp in filenames:
            out, err, ret = run_command(['desktop-file-validate', fp])
            for issue in parse_desktop_file_validate(out.splitlines()):
                analysis.results.append(issue)
                failed = True
            log += out
    log = log.strip()
    return (analysis, log, failed)
示例#2
0
def desktop_file_validate(package_root, analysis):
    log = ""
    failed = False
    for dirpath, dirnames, filenames in os.walk(package_root):
        for fp in filenames:
            out, err, ret = run_command(['desktop-file-validate', fp])
            for issue in parse_desktop_file_validate(out.splitlines()):
                analysis.results.append(issue)
                failed = True
            log += out
    log = log.strip()
    return (analysis, log, failed)
def test_desktop_file_validate():
    for string, expected in STRINGS:
        issue = next(parse_desktop_file_validate([string]))
        assert issue.severity == expected
def test_desktop_file_validate():
    for string, expected in STRINGS:
        issue = next(parse_desktop_file_validate([string]))
        assert issue.severity == expected