mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-02 17:59:28 +01:00
Initial python3 changes
Mostly just updating libraries, removing string encoding/decoding, fixing some edge cases. No new functionality was added in this commit.
This commit is contained in:
43
lib/pkg_resources/tests/test_find_distributions.py
Normal file
43
lib/pkg_resources/tests/test_find_distributions.py
Normal file
@@ -0,0 +1,43 @@
|
||||
import py
|
||||
import pytest
|
||||
import pkg_resources
|
||||
|
||||
|
||||
TESTS_DATA_DIR = py.path.local(__file__).dirpath('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):
|
||||
(TESTS_DATA_DIR / 'my-test-package_unpacked-egg').copy(target_dir)
|
||||
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):
|
||||
(TESTS_DATA_DIR / 'my-test-package_zipped-egg').copy(target_dir)
|
||||
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):
|
||||
(TESTS_DATA_DIR / 'my-test-package-zip').copy(target_dir)
|
||||
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)
|
||||
Reference in New Issue
Block a user