#NEWLINE# def test_inconsistentImporterCache( self ) : #NEWLINE# #INDENT# '\n        If the path a module loaded with L{PythonPath.__getitem__} is not\n        present in the path importer cache, a warning is emitted, but the\n        L{PythonModule} is returned as usual.\n        ' #NEWLINE# space = modules . PythonPath ( [ ] , sys . modules , [ ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# thisModule = space [ __name__ ] #NEWLINE# warnings = self . flushWarnings ( [ self . test_inconsistentImporterCache ] ) #NEWLINE# self . assertEqual ( warnings [ 0 ] [ 'category' ] , UserWarning ) #NEWLINE# 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).' ) ) #NEWLINE# self . assertEqual ( len ( warnings ) , 1 ) #NEWLINE# self . assertEqual ( thisModule . name , __name__ )