OXIESEC PANEL
- Current Dir:
/
/
snap
/
certbot
/
4730
/
lib
/
python3.12
/
site-packages
/
pkg_resources
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
__init__.py
0 bytes
06/10/2025 09:50:49 PM
rw-r--r--
📁
__pycache__
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📁
data
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
test_find_distributions.py
1.93 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_integration_zope_interface.py
1.61 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_markers.py
241 bytes
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_pkg_resources.py
16.71 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_resources.py
30.52 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_working_set.py
8.4 KB
06/10/2025 09:50:49 PM
rw-r--r--
Editing: test_find_distributions.py
Close
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)