File: test_os_short_ids.py

package info (click to toggle)
osinfo-db 0.20221130-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 22,780 kB
  • sloc: python: 1,672; sh: 344; makefile: 89
file content (19 lines) | stat: -rw-r--r-- 419 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.

import re

from . import util


@util.os_parametrize("osxml")
def test_validate_short_ids(osxml):
    invalids = []

    pattern = r"[a-z0-9\.\-]"
    for shortid in osxml.shortids:
        result = re.match(pattern, shortid)
        if not result:
            invalids.append(shortid)

    assert invalids == []