diff options
Diffstat (limited to 'tests/test_path.py')
| -rw-r--r-- | tests/test_path.py | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/tests/test_path.py b/tests/test_path.py index f93b0ae90..12c0d4a64 100644 --- a/tests/test_path.py +++ b/tests/test_path.py @@ -259,34 +259,23 @@ class TestPkgResourcesAssetDescriptor(unittest.TestCase): def test_stream(self): inst = self._makeOne() - inst.pkg_resources = DummyPkgResource() - inst.pkg_resources.resource_stream = lambda x, y: f'{x}:{y}' - s = inst.stream() - self.assertEqual(s, '{}:{}'.format('tests', 'test_asset.py')) + stream = inst.stream() + data = stream.read(9) + self.assertEqual(data, b"import os") def test_isdir(self): inst = self._makeOne() - inst.pkg_resources = DummyPkgResource() - inst.pkg_resources.resource_isdir = lambda x, y: f'{x}:{y}' - self.assertEqual( - inst.isdir(), '{}:{}'.format('tests', 'test_asset.py') - ) + self.assertEqual(inst.isdir(), False) def test_listdir(self): - inst = self._makeOne() - inst.pkg_resources = DummyPkgResource() - inst.pkg_resources.resource_listdir = lambda x, y: f'{x}:{y}' - self.assertEqual( - inst.listdir(), '{}:{}'.format('tests', 'test_asset.py') - ) + inst = self._makeOne(path="") + content = inst.listdir() + self.assertIn("test_asset.py", content) + self.assertNotIn("test_foobardou", content) def test_exists(self): inst = self._makeOne() - inst.pkg_resources = DummyPkgResource() - inst.pkg_resources.resource_exists = lambda x, y: f'{x}:{y}' - self.assertEqual( - inst.exists(), '{}:{}'.format('tests', 'test_asset.py') - ) + self.assertEqual(inst.exists(), True) class TestFSAssetDescriptor(unittest.TestCase): |
