You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
829 B
38 lines
829 B
import unittest
|
|
from importlib import resources
|
|
|
|
from . import util
|
|
|
|
|
|
class ContentsTests:
|
|
expected = {
|
|
'__init__.py',
|
|
'binary.file',
|
|
'subdirectory',
|
|
'utf-16.file',
|
|
'utf-8.file',
|
|
}
|
|
|
|
def test_contents(self):
|
|
contents = {path.name for path in resources.files(self.data).iterdir()}
|
|
assert self.expected <= contents
|
|
|
|
|
|
class ContentsDiskTests(ContentsTests, util.DiskSetup, unittest.TestCase):
|
|
pass
|
|
|
|
|
|
class ContentsZipTests(ContentsTests, util.ZipSetup, unittest.TestCase):
|
|
pass
|
|
|
|
|
|
class ContentsNamespaceTests(ContentsTests, util.DiskSetup, unittest.TestCase):
|
|
MODULE = 'namespacedata01'
|
|
|
|
expected = {
|
|
# no __init__ because of namespace design
|
|
'binary.file',
|
|
'subdirectory',
|
|
'utf-16.file',
|
|
'utf-8.file',
|
|
}
|
|
|