From 97319b2d2239974b04cbef2b82d5405758095b7c Mon Sep 17 00:00:00 2001 From: Theron Luhn Date: Sun, 24 Aug 2025 16:28:04 -0700 Subject: Implement our own version of `resource_filename`. --- tests/test_path.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/test_path.py b/tests/test_path.py index af3dfb500..968739af4 100644 --- a/tests/test_path.py +++ b/tests/test_path.py @@ -4,6 +4,20 @@ import unittest here = os.path.abspath(os.path.dirname(__file__)) +class TestResourceFilename(unittest.TestCase): + def _callFUT(self, package, name): + from pyramid.path import resource_filename + + 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) + + class TestCallerPath(unittest.TestCase): def tearDown(self): from . import test_path -- cgit v1.2.3