diff options
| author | shadchin <[email protected]> | 2022-02-10 16:44:30 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:30 +0300 | 
| commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
| tree | 012bb94d777798f1f56ac1cec429509766d05181 /library/python/runtime_py3/test | |
| parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/python/runtime_py3/test')
9 files changed, 146 insertions, 146 deletions
diff --git a/library/python/runtime_py3/test/.dist-info/METADATA b/library/python/runtime_py3/test/.dist-info/METADATA index bb361621993..a2af7dff1a8 100644 --- a/library/python/runtime_py3/test/.dist-info/METADATA +++ b/library/python/runtime_py3/test/.dist-info/METADATA @@ -1,14 +1,14 @@ -Metadata-Version: 2.1 -Name: foo-bar -Version: 1.2.3 -Summary:  -Home-page: https://foo.org/ -Author: Foo -Author-email: [email protected] -License: UNKNOWN -Platform: any -Classifier: Development Status :: 4 - Beta -Classifier: Programming Language :: Python :: 3 -Requires-Python: >=3.8 -Requires-Dist: Werkzeug (>=0.15) -Requires-Dist: Jinja2 (>=2.10.1) +Metadata-Version: 2.1  +Name: foo-bar  +Version: 1.2.3  +Summary:   +Home-page: https://foo.org/  +Author: Foo  +Author-email: [email protected]  +License: UNKNOWN  +Platform: any  +Classifier: Development Status :: 4 - Beta  +Classifier: Programming Language :: Python :: 3  +Requires-Python: >=3.8  +Requires-Dist: Werkzeug (>=0.15)  +Requires-Dist: Jinja2 (>=2.10.1)  diff --git a/library/python/runtime_py3/test/.dist-info/RECORD b/library/python/runtime_py3/test/.dist-info/RECORD index dabbbff80d9..4199b6becef 100644 --- a/library/python/runtime_py3/test/.dist-info/RECORD +++ b/library/python/runtime_py3/test/.dist-info/RECORD @@ -1 +1 @@ -foo_bar.py,sha256=0000000000000000000000000000000000000000000,20 +foo_bar.py,sha256=0000000000000000000000000000000000000000000,20  diff --git a/library/python/runtime_py3/test/.dist-info/entry_points.txt b/library/python/runtime_py3/test/.dist-info/entry_points.txt index f5e2fd2657b..525429d6585 100644 --- a/library/python/runtime_py3/test/.dist-info/entry_points.txt +++ b/library/python/runtime_py3/test/.dist-info/entry_points.txt @@ -1,2 +1,2 @@ -[console_scripts] -foo_cli = foo_bar:cli +[console_scripts]  +foo_cli = foo_bar:cli  diff --git a/library/python/runtime_py3/test/.dist-info/top_level.txt b/library/python/runtime_py3/test/.dist-info/top_level.txt index d2c068bc6be..8009c4b1f16 100644 --- a/library/python/runtime_py3/test/.dist-info/top_level.txt +++ b/library/python/runtime_py3/test/.dist-info/top_level.txt @@ -1 +1 @@ -foo_bar +foo_bar  diff --git a/library/python/runtime_py3/test/resources/foo.txt b/library/python/runtime_py3/test/resources/foo.txt index ba0e162e1c4..59ea98c2c66 100644 --- a/library/python/runtime_py3/test/resources/foo.txt +++ b/library/python/runtime_py3/test/resources/foo.txt @@ -1 +1 @@ -bar
\ No newline at end of file +bar 
\ No newline at end of file diff --git a/library/python/runtime_py3/test/resources/submodule/bar.txt b/library/python/runtime_py3/test/resources/submodule/bar.txt index 19102815663..356e2c858ca 100644 --- a/library/python/runtime_py3/test/resources/submodule/bar.txt +++ b/library/python/runtime_py3/test/resources/submodule/bar.txt @@ -1 +1 @@ -foo
\ No newline at end of file +foo 
\ No newline at end of file diff --git a/library/python/runtime_py3/test/test_metadata.py b/library/python/runtime_py3/test/test_metadata.py index 686c176468e..7e7d9f0c1c0 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 - - [email protected]("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  +  +  [email protected]("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  diff --git a/library/python/runtime_py3/test/test_resources.py b/library/python/runtime_py3/test/test_resources.py index a269329f42c..8eb05380a5c 100644 --- a/library/python/runtime_py3/test/test_resources.py +++ b/library/python/runtime_py3/test/test_resources.py @@ -1,60 +1,60 @@ -# -*- coding: utf-8 -*- - -import importlib.resources as ir - -import pytest - - [email protected]("package, resource", ( -    ("resources", "foo.txt"), -    ("resources.submodule", "bar.txt") -)) -def test_is_resource_good_path(package, resource): -    assert ir.is_resource(package, resource) - - [email protected]("package, resource", ( -    ("resources", "111.txt"), -    ("resources.submodule", "222.txt") -)) -def test_is_resource_missing(package, resource): -    assert not ir.is_resource(package, resource) - - -def test_is_resource_subresource_directory(): -    # Directories are not resources. -    assert not ir.is_resource("resources", "submodule") - - [email protected]("package, resource, expected", ( -    ("resources", "foo.txt", b"bar"), -    ("resources.submodule", "bar.txt", b"foo") -)) -def test_read_binary_good_path(package, resource, expected): -    assert ir.read_binary(package, resource) == expected - - -def test_read_binary_missing(): -    with pytest.raises(FileNotFoundError): -        ir.read_binary("resources", "111.txt") - - [email protected]("package, resource, expected", ( -    ("resources", "foo.txt", "bar"), -    ("resources.submodule", "bar.txt", "foo") -)) -def test_read_text_good_path(package, resource, expected): -    assert ir.read_text(package, resource) == expected - - -def test_read_text_missing(): -    with pytest.raises(FileNotFoundError): -        ir.read_text("resources", "111.txt") - - [email protected]("package, expected", ( -    ("resources", ["submodule", "foo.txt"]), -    ("resources.submodule", ["bar.txt"]) -)) -def test_contents_good_path(package, expected): -    assert sorted(ir.contents(package)) == sorted(expected) +# -*- coding: utf-8 -*-  +  +import importlib.resources as ir  +  +import pytest  +  +  [email protected]("package, resource", (  +    ("resources", "foo.txt"),  +    ("resources.submodule", "bar.txt")  +))  +def test_is_resource_good_path(package, resource):  +    assert ir.is_resource(package, resource)  +  +  [email protected]("package, resource", (  +    ("resources", "111.txt"),  +    ("resources.submodule", "222.txt")  +))  +def test_is_resource_missing(package, resource):  +    assert not ir.is_resource(package, resource)  +  +  +def test_is_resource_subresource_directory():  +    # Directories are not resources.  +    assert not ir.is_resource("resources", "submodule")  +  +  [email protected]("package, resource, expected", (  +    ("resources", "foo.txt", b"bar"),  +    ("resources.submodule", "bar.txt", b"foo")  +))  +def test_read_binary_good_path(package, resource, expected):  +    assert ir.read_binary(package, resource) == expected  +  +  +def test_read_binary_missing():  +    with pytest.raises(FileNotFoundError):  +        ir.read_binary("resources", "111.txt")  +  +  [email protected]("package, resource, expected", (  +    ("resources", "foo.txt", "bar"),  +    ("resources.submodule", "bar.txt", "foo")  +))  +def test_read_text_good_path(package, resource, expected):  +    assert ir.read_text(package, resource) == expected  +  +  +def test_read_text_missing():  +    with pytest.raises(FileNotFoundError):  +        ir.read_text("resources", "111.txt")  +  +  [email protected]("package, expected", (  +    ("resources", ["submodule", "foo.txt"]),  +    ("resources.submodule", ["bar.txt"])  +))  +def test_contents_good_path(package, expected):  +    assert sorted(ir.contents(package)) == sorted(expected)  diff --git a/library/python/runtime_py3/test/ya.make b/library/python/runtime_py3/test/ya.make index 4ec3db74f5d..9056e48a395 100644 --- a/library/python/runtime_py3/test/ya.make +++ b/library/python/runtime_py3/test/ya.make @@ -12,29 +12,29 @@ PEERDIR(      contrib/python/PyYAML  ) -PY_SRCS( -    TOP_LEVEL -    resources/__init__.py -    resources/submodule/__init__.py -) - -TEST_SRCS( -    test_metadata.py -    test_resources.py -    test_traceback.py +PY_SRCS(  +    TOP_LEVEL  +    resources/__init__.py  +    resources/submodule/__init__.py  +)  + +TEST_SRCS(  +    test_metadata.py  +    test_resources.py  +    test_traceback.py       test_arcadia_source_finder.py -) - -RESOURCE_FILES( -    PREFIX library/python/runtime_py3/test/ -    .dist-info/METADATA -    .dist-info/RECORD -    .dist-info/entry_points.txt -    .dist-info/top_level.txt -    resources/foo.txt -    resources/submodule/bar.txt -) - +)  +  +RESOURCE_FILES(  +    PREFIX library/python/runtime_py3/test/  +    .dist-info/METADATA  +    .dist-info/RECORD  +    .dist-info/entry_points.txt  +    .dist-info/top_level.txt  +    resources/foo.txt  +    resources/submodule/bar.txt  +)  +   END()  RECURSE_FOR_TESTS(traceback)  | 
