def METHOD_NAME(regen=REGEN):
    expected_file = os.path.join(BASE_DIR, "test_data/nvd/nvd-expected.json")
    test_data = load_test_data()
    result = [data.to_dict() for data in nvd.to_advisories(test_data)]
    result = sorted_advisory_data(result)
    if regen:
        with open(expected_file, "w") as f:
            json.dump(result, f, indent=2)
        expected = result
    else:
        with open(expected_file) as f:
            expected = json.load(f)
    expected = sorted_advisory_data(expected)
    assert result == expected