view Lib/importlib/test/source/test_path_hook.py @ 78069:a8aa77458e12 3.2

Add c_size_t and c_ssize_t to the ctypes summary table.
author Antoine Pitrou <solipsis@pitrou.net>
date Thu, 12 Jul 2012 20:31:50 +0200
parents 34f015bca54e
children 2dd046be2c88
line wrap: on
line source

from importlib import _bootstrap
from . import util as source_util
import unittest


class PathHookTest(unittest.TestCase):

    """Test the path hook for source."""

    def test_success(self):
        with source_util.create_modules('dummy') as mapping:
            self.assertTrue(hasattr(_bootstrap._file_path_hook(mapping['.root']),
                                 'find_module'))

    def test_empty_string(self):
        # The empty string represents the cwd.
        self.assertTrue(hasattr(_bootstrap._file_path_hook(''), 'find_module'))


def test_main():
    from test.support import run_unittest
    run_unittest(PathHookTest)


if __name__ == '__main__':
    test_main()