aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/lib/nots/package_manager/base/tests/utils.py
blob: 4287beec47042eabca91a49ef26d5b17e3c97065 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from build.plugins.lib.nots.package_manager.base 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]