summaryrefslogtreecommitdiffstats
path: root/tests/lsp_tests/test_debpkg_metadata.py
blob: fdb0df8ded82e0ba7a036b1438e64e4e8d16bd98 (plain)
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: Optional[str]) -> None:
    assert package_name_to_section(name) == guessed_section