diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /library/python/runtime_py3/test/test_metadata.py | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/runtime_py3/test/test_metadata.py')
-rw-r--r-- | library/python/runtime_py3/test/test_metadata.py | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/library/python/runtime_py3/test/test_metadata.py b/library/python/runtime_py3/test/test_metadata.py index 686c176468..7e7d9f0c1c 100644 --- a/library/python/runtime_py3/test/test_metadata.py +++ b/library/python/runtime_py3/test/test_metadata.py @@ -1,44 +1,44 @@ -import importlib.metadata as im - -import pytest - - -@pytest.mark.parametrize("name", ("foo-bar", "foo_bar", "Foo-Bar")) -def test_distribution(name): - assert im.distribution(name) is not None - - -def test_unknown_package(): - with pytest.raises(im.PackageNotFoundError): - im.distribution("bar") - - -def test_version(): - assert im.version("foo-bar") == "1.2.3" - - -def test_metadata(): - assert im.metadata("foo-bar") is not None - - -def test_files(): - files = im.files("foo-bar") - assert len(files) == 1 - assert files[0].name == "foo_bar.py" - assert files[0].size == 20 - - -def test_requires(): - assert im.requires("foo-bar") == ["Werkzeug (>=0.15)", "Jinja2 (>=2.10.1)"] - - -def test_entry_points(): - entry_points = im.entry_points() - assert "console_scripts" in entry_points - - flg_found = False - for entry_point in entry_points["console_scripts"]: - if entry_point.name == "foo_cli" and entry_point.value == "foo_bar:cli": - flg_found = True - - assert flg_found +import importlib.metadata as im + +import pytest + + +@pytest.mark.parametrize("name", ("foo-bar", "foo_bar", "Foo-Bar")) +def test_distribution(name): + assert im.distribution(name) is not None + + +def test_unknown_package(): + with pytest.raises(im.PackageNotFoundError): + im.distribution("bar") + + +def test_version(): + assert im.version("foo-bar") == "1.2.3" + + +def test_metadata(): + assert im.metadata("foo-bar") is not None + + +def test_files(): + files = im.files("foo-bar") + assert len(files) == 1 + assert files[0].name == "foo_bar.py" + assert files[0].size == 20 + + +def test_requires(): + assert im.requires("foo-bar") == ["Werkzeug (>=0.15)", "Jinja2 (>=2.10.1)"] + + +def test_entry_points(): + entry_points = im.entry_points() + assert "console_scripts" in entry_points + + flg_found = False + for entry_point in entry_points["console_scripts"]: + if entry_point.name == "foo_cli" and entry_point.value == "foo_bar:cli": + flg_found = True + + assert flg_found |