summaryrefslogtreecommitdiffstats
path: root/build/plugins/lib/nots/package_manager/tests/test_utils.py
blob: a6a29a4284044053638b5b1d93965d0e22c62158 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from build.plugins.lib.nots.package_manager import utils


def test_extract_package_name_from_path():
    happy_checklist = [
        ("@yandex-int/foo-bar-baz/some/path/inside/the/package", "@yandex-int/foo-bar-baz"),
        ("@yandex-int/foo-bar-buzz", "@yandex-int/foo-bar-buzz"),
        ("package-wo-scope", "package-wo-scope"),
        ("p", "p"),
        ("", ""),
    ]

    for item in happy_checklist:
        package_name = utils.extract_package_name_from_path(item[0])
        assert package_name == item[1]