test/test_parser.py
branchfeature/fix-test_parser-keys_to_test
changeset 179 2fb992c480e4
parent 166 6cbe4891d62a
equal deleted inserted replaced
167:7bec7a730d69 179:2fb992c480e4
    83             # Load expected result
    83             # Load expected result
    84             with open(os.path.join(expect_path, domain)) as infil:
    84             with open(os.path.join(expect_path, domain)) as infil:
    85                 expected_results = json.load(infil)
    85                 expected_results = json.load(infil)
    86 
    86 
    87             # Compare each key
    87             # Compare each key
    88             for key in set(results).union(set(expected_results)):
    88             compare_keys = set.union(set(results), set(expected_results))
       
    89             if keys_to_test is not None:
       
    90                 compare_keys = compare_keys.intersection(set(keys_to_test))
       
    91             for key in compare_keys:
    89                 total += 1
    92                 total += 1
    90                 if key not in results:
    93                 if key not in results:
    91                     print("%s \t(%s):\t Missing in results" % (domain, key,))
    94                     print("%s \t(%s):\t Missing in results" % (domain, key,))
    92                     fail += 1
    95                     fail += 1
    93                     continue
    96                     continue