def test_unhandledImporter(self):
        class SecretImporter(object):
            pass

        def hook(name):
            return SecretImporter()

        syspath = ['example/path']
        sysmodules = {}
        syshooks = [hook]
        syscache = {}
        def sysloader(name):
            return None
        space = modules.PythonPath(
            syspath, sysmodules, syshooks, syscache, sysloader)
        entries = list(space.iterEntries())
        self.assertEqual(len(entries), 1)
        self.assertRaises(KeyError, lambda: entries[0]['module'])
Make sure that the behavior when encountering an unknown importer
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/test/test_modules.py/PythonPathTestCase.test_unhandledImporter