From bb7833b040b3ca720467c4327cc618b8b107783f Mon Sep 17 00:00:00 2001 From: Theron Luhn Date: Sun, 24 Aug 2025 20:01:18 -0700 Subject: Test against actual assets. --- tests/pkgs/assets/__init__.py | 0 tests/pkgs/assets/dir/fizz.txt | 1 + tests/pkgs/assets/foo.txt | 1 + tests/test_path.py | 8 +++----- 4 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 tests/pkgs/assets/__init__.py create mode 100644 tests/pkgs/assets/dir/fizz.txt create mode 100644 tests/pkgs/assets/foo.txt diff --git a/tests/pkgs/assets/__init__.py b/tests/pkgs/assets/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/pkgs/assets/dir/fizz.txt b/tests/pkgs/assets/dir/fizz.txt new file mode 100644 index 000000000..99f1ea4a2 --- /dev/null +++ b/tests/pkgs/assets/dir/fizz.txt @@ -0,0 +1 @@ +buzz diff --git a/tests/pkgs/assets/foo.txt b/tests/pkgs/assets/foo.txt new file mode 100644 index 000000000..5716ca598 --- /dev/null +++ b/tests/pkgs/assets/foo.txt @@ -0,0 +1 @@ +bar diff --git a/tests/test_path.py b/tests/test_path.py index 968739af4..f93b0ae90 100644 --- a/tests/test_path.py +++ b/tests/test_path.py @@ -11,11 +11,9 @@ class TestResourceFilename(unittest.TestCase): return resource_filename(package, name) def test_returns_path(self): - path = self._callFUT('tests', 'test_path.py') - self.assertIsInstance(path, str) - # If it's a real path, we should be able to open and read from it. - with open(path) as fh: - assert fh.read(1) + path = self._callFUT('tests.pkgs.assets', 'foo.txt') + expected = os.path.join(here, 'pkgs/assets/foo.txt') + self.assertEqual(path, expected) class TestCallerPath(unittest.TestCase): -- cgit v1.2.3