Skip to content

Commit 6daf3d4

Browse files
committed
Test zip data for path()
1 parent 6ac5da6 commit 6daf3d4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

importlib_resources/tests/test_path.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,23 @@ def execute(self, package, path):
1616
pass
1717

1818

19-
class PathTests(unittest.TestCase):
19+
class PathTests:
2020

2121
def test_reading(self):
2222
# Path should be readable.
2323
# Test also implicitly verifies the returned object is a pathlib.Path
2424
# instance.
25-
with resources.path(data, 'utf-8.file') as path:
25+
with resources.path(self.data, 'utf-8.file') as path:
2626
# pathlib.Path.read_text() was introduced in Python 3.5.
2727
with path.open('r', encoding='utf-8') as file:
2828
text = file.read()
2929
self.assertEqual('Hello, UTF-8 world!\n', text)
30+
31+
32+
class PathDiskTests(PathTests, unittest.TestCase):
33+
34+
data = data
35+
36+
37+
class PathZipTests(PathTests, util.ZipSetup, unittest.TestCase):
38+
pass

0 commit comments

Comments
 (0)