GRAYBYTE WORDPRESS FILE MANAGER3867

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/cloudlinux/venv/lib/python3.11/site-packages/pkg_resources/tests/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/pkg_resources/tests//test_find_distributions.py
import shutil
from pathlib import Path

import pytest

import pkg_resources

TESTS_DATA_DIR = Path(__file__).parent / 'data'


class TestFindDistributions:
    @pytest.fixture
    def target_dir(self, tmpdir):
        target_dir = tmpdir.mkdir('target')
        # place a .egg named directory in the target that is not an egg:
        target_dir.mkdir('not.an.egg')
        return target_dir

    def test_non_egg_dir_named_egg(self, target_dir):
        dists = pkg_resources.find_distributions(str(target_dir))
        assert not list(dists)

    def test_standalone_egg_directory(self, target_dir):
        shutil.copytree(
            TESTS_DATA_DIR / 'my-test-package_unpacked-egg',
            target_dir,
            dirs_exist_ok=True,
        )
        dists = pkg_resources.find_distributions(str(target_dir))
        assert [dist.project_name for dist in dists] == ['my-test-package']
        dists = pkg_resources.find_distributions(str(target_dir), only=True)
        assert not list(dists)

    def test_zipped_egg(self, target_dir):
        shutil.copytree(
            TESTS_DATA_DIR / 'my-test-package_zipped-egg',
            target_dir,
            dirs_exist_ok=True,
        )
        dists = pkg_resources.find_distributions(str(target_dir))
        assert [dist.project_name for dist in dists] == ['my-test-package']
        dists = pkg_resources.find_distributions(str(target_dir), only=True)
        assert not list(dists)

    def test_zipped_sdist_one_level_removed(self, target_dir):
        shutil.copytree(
            TESTS_DATA_DIR / 'my-test-package-zip', target_dir, dirs_exist_ok=True
        )
        dists = pkg_resources.find_distributions(
            str(target_dir / "my-test-package.zip")
        )
        assert [dist.project_name for dist in dists] == ['my-test-package']
        dists = pkg_resources.find_distributions(
            str(target_dir / "my-test-package.zip"), only=True
        )
        assert not list(dists)

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 15 2025 08:30:34
root / root
0755
__pycache__
--
May 15 2025 08:30:34
root / root
0755
data
--
April 17 2025 13:10:58
root / root
0755
__init__.py
0 KB
April 17 2025 13:10:58
root / root
0644
test_find_distributions.py
1.926 KB
April 17 2025 13:10:58
root / root
0644
test_integration_zope_interface.py
1.613 KB
April 17 2025 13:10:58
root / root
0644
test_markers.py
0.235 KB
April 17 2025 13:10:58
root / root
0644
test_pkg_resources.py
16.71 KB
April 17 2025 13:10:58
root / root
0644
test_resources.py
30.52 KB
April 17 2025 13:10:58
root / root
0644
test_working_set.py
8.4 KB
April 17 2025 13:10:58
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF