Skip to content

Commit

Permalink
tests/read: add test for namespace packages
Browse files Browse the repository at this point in the history
Signed-off-by: Filipe Laíns <lains@riseup.net>
  • Loading branch information
FFY00 committed May 12, 2021
1 parent ef37d6d commit 556ffa5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion importlib_resources/tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import importlib_resources as resources
from importlib_resources.abc import Traversable
from . import data01
from . import namespacedata01
from . import util


Expand Down Expand Up @@ -38,6 +37,8 @@ class OpenZipTests(FilesTests, util.ZipSetup, unittest.TestCase):

class OpenNamespaceTests(FilesTests, unittest.TestCase):
def setUp(self):
from . import namespacedata01

self.data = namespacedata01


Expand Down
7 changes: 7 additions & 0 deletions importlib_resources/tests/test_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,12 @@ def test_read_submodule_resource_by_name(self):
self.assertEqual(result, b'\0\1\2\3')


class ReadNamespaceTests(ReadTests, unittest.TestCase):
def setUp(self):
from . import namespacedata01

self.data = namespacedata01


if __name__ == '__main__':
unittest.main()

0 comments on commit 556ffa5

Please sign in to comment.