diff options
| author | Theron Luhn <theron@luhn.com> | 2025-08-24 20:01:18 -0700 |
|---|---|---|
| committer | Theron Luhn <theron@luhn.com> | 2025-08-24 20:01:18 -0700 |
| commit | bb7833b040b3ca720467c4327cc618b8b107783f (patch) | |
| tree | 58772f360adb0e12077cecf5e80fcff9797190ed | |
| parent | b62b0e6c080e572786433f0475f268a41ec66e32 (diff) | |
| download | pyramid-bb7833b040b3ca720467c4327cc618b8b107783f.tar.gz pyramid-bb7833b040b3ca720467c4327cc618b8b107783f.tar.bz2 pyramid-bb7833b040b3ca720467c4327cc618b8b107783f.zip | |
Test against actual assets.
| -rw-r--r-- | tests/pkgs/assets/__init__.py | 0 | ||||
| -rw-r--r-- | tests/pkgs/assets/dir/fizz.txt | 1 | ||||
| -rw-r--r-- | tests/pkgs/assets/foo.txt | 1 | ||||
| -rw-r--r-- | tests/test_path.py | 8 |
4 files changed, 5 insertions, 5 deletions
diff --git a/tests/pkgs/assets/__init__.py b/tests/pkgs/assets/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/pkgs/assets/__init__.py 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): |
