Beispiel #1
0
def test_fs_check_existing(root, rules_path, vendor, board, ide):
    results = afqp_check.check_fs(root, rules_path, vendor, board, ide)
    for result in results:
        assert result.type == 'warning', '({}, {})'.format(
            result.type, result.info)
        assert result.type != 'error', '({}, {})'.format(
            result.type, result.info)
Beispiel #2
0
def test_fs_check_nonexisting(root, rules_path, vendor, board, ide):
    results = afqp_check.check_fs(root, rules_path, vendor, board, ide)
    with open(rules_path, 'r') as rules_file:
        rules = json.load(rules_file)
    sum_errors = 0
    sum_warnings = 0
    for result in results:
        if result.type == 'error':
            sum_errors += 1
        if result.type == 'warning':
            sum_warnings += 1
    assert sum_errors == len(rules['error'])
    assert sum_warnings == len(rules['warning'])