mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00

+ Ditch using arguments to super(). + Ditch subclassing from object directly. + Move directory check out of chaining path hook to file path hook/finder. + Rename some classes to better reflect they are finders, not importers.
23 lines
548 B
Python
23 lines
548 B
Python
import importlib
|
|
from . import util as source_util
|
|
import unittest
|
|
|
|
|
|
class PathHookTest(unittest.TestCase):
|
|
|
|
"""Test the path hook for source."""
|
|
|
|
def test_success(self):
|
|
# XXX Only work on existing directories?
|
|
with source_util.create_modules('dummy') as mapping:
|
|
self.assert_(hasattr(importlib.FileFinder(mapping['.root']),
|
|
'find_module'))
|
|
|
|
|
|
def test_main():
|
|
from test.support import run_unittest
|
|
run_unittest(PathHookTest)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
test_main()
|