from importlib.resources import path
-class BespokeLoader:
- archive = 'bespoke'
-
-
class TestZip(unittest.TestCase):
def setUp(self):
- # Find the path to the example.*.whl so we can add it to the front of
+ # Find the path to the example-*.whl so we can add it to the front of
# sys.path, where we'll then try to find the metadata thereof.
self.resources = ExitStack()
self.addCleanup(self.resources.close)
for file in files('example'):
path = str(file.dist.locate_file(file))
assert '.whl/' in path, path
+
+
+class TestEgg(TestZip):
+ def setUp(self):
+ # Find the path to the example-*.egg so we can add it to the front of
+ # sys.path, where we'll then try to find the metadata thereof.
+ self.resources = ExitStack()
+ self.addCleanup(self.resources.close)
+ egg = self.resources.enter_context(
+ path('importlib_metadata.tests.data',
+ 'example-21.12-py3.6.egg'))
+ sys.path.insert(0, str(egg))
+ self.resources.callback(sys.path.pop, 0)
+
+ def test_files(self):
+ for file in files('example'):
+ path = str(file.dist.locate_file(file))
+ assert '.egg/' in path, path