def test_version_definitions(path):
    assert path.suffix == '.json', '{} has wrong extension'.format(path)
    assert re.match(r'^\d\.\d(?:\-32)?$', path.stem), \
        '{} has invalid name'.format(path)

    with path.open() as f:
        data = json.load(f)

    schema = data.pop('type')
    possible_types = snafu.versions.InstallerType.__members__
    assert schema in possible_types

    assert isinstance(data.pop('version_info'), list)

    if schema == 'cpython_msi':
        for key in ('x86', 'amd64'):
            d = data.pop(key)
            assert d.pop('url')
            assert re.match(r'^[a-f\d]{32}$', d.pop('md5_sum'))
    elif schema == 'cpython':
        assert data.pop('url')
        assert re.match(r'^[a-f\d]{32}$', data.pop('md5_sum'))

    assert not data, 'superfulous keys: {}'.format(', '.join(data.keys()))