aboutsummaryrefslogtreecommitdiff
path: root/pw_build/py/create_python_tree_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'pw_build/py/create_python_tree_test.py')
-rw-r--r--pw_build/py/create_python_tree_test.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pw_build/py/create_python_tree_test.py b/pw_build/py/create_python_tree_test.py
index d545a0ffe..f4922046a 100644
--- a/pw_build/py/create_python_tree_test.py
+++ b/pw_build/py/create_python_tree_test.py
@@ -13,6 +13,7 @@
# the License.
"""Tests for pw_build.create_python_tree"""
+import importlib.resources
import io
import os
from pathlib import Path
@@ -31,6 +32,8 @@ from pw_build.create_python_tree import (
)
from pw_build.generate_python_package import PYPROJECT_FILE
+import test_dist1_data # type: ignore
+
def _setup_cfg(package_name: str, install_requires: str = '') -> str:
return f'''
@@ -494,6 +497,18 @@ saturn =
# Check expected files are in place.
self._check_result_paths_equal(install_dir, expected_file_list)
+ def test_importing_package_data(self) -> None:
+ self.assertIn(
+ 'EMPTY.CSV',
+ importlib.resources.read_text(test_dist1_data, 'empty.csv'),
+ )
+ self.assertIn(
+ 'EMPTY.CSV',
+ importlib.resources.read_text(
+ 'test_dist1_data.subdir', 'empty.csv'
+ ),
+ )
+
if __name__ == '__main__':
unittest.main()