File: test_debpkg_metadata.py

package info (click to toggle)
debputy 0.1.79
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,660 kB
  • sloc: python: 67,209; perl: 155; sh: 102; makefile: 39
file content (25 lines) | stat: -rw-r--r-- 715 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from typing import Optional

import pytest

from debputy.lsp.lsp_debian_control_reference_data import package_name_to_section


@pytest.mark.parametrize(
    "name,guessed_section",
    [
        ("foo-udeb", "debian-installer"),
        ("python-foo", "python"),
        ("python-foo-doc", "doc"),
        ("libfoo-dev", "libdevel"),
        ("php-foo", "php"),
        ("libpam-foo", "admin"),
        ("fonts-foo", "fonts"),
        ("xxx-l10n", "localization"),
        ("xxx-l10n-bar", "localization"),
        ("libfoo4", "libs"),
        ("unknown", None),
    ],
)
def test_package_name_to_section(name: str, guessed_section: str | None) -> None:
    assert package_name_to_section(name) == guessed_section