'If the path a module loaded with L{PythonPath.__getitem__} is not
present in the path importer cache, a warning is emitted, but the
L{PythonModule} is returned as usual.'

def test_inconsistentImporterCache(self):

    space = modules.PythonPath([], sys.modules, [], {})
    thisModule = space[__name__]
    warnings = self.flushWarnings([self.test_inconsistentImporterCache])
    self.assertEqual(warnings[0]['category'], UserWarning)
    self.assertEqual(warnings[0]['message'], (((FilePath(twisted.__file__).parent().dirname() + '    (for    module    ') + __name__) + ')    not    in    path    importer    cache    (PEP    302    violation    -    check    your    local    configuration).'))
    self.assertEqual(len(warnings), 1)
    self.assertEqual(thisModule.name, __name__)
