'Check that the cache returned by L{plugin.getCache} hold the plugin
B{testplugin}, and that this plugin has the properties we expect:
provide L{TestPlugin}, has the good name and description, and can be
loaded successfully.'

def test_cache(self):

    cache = plugin.getCache(self.module)
    dropin = cache[self.originalPlugin]
    self.assertEqual(dropin.moduleName, ('mypackage.%s' % (self.originalPlugin,)))
    self.assertIn("I'm    a    test    drop-in.", dropin.description)
    p1 = [p for p in dropin.plugins if (ITestPlugin in p.provided)][0]
    self.assertIs(p1.dropin, dropin)
    self.assertEqual(p1.name, 'TestPlugin')
    self.assertEqual(p1.description.strip(), 'A    plugin    used    solely    for    testing    purposes.')
    self.assertEqual(p1.provided, [ITestPlugin, plugin.IPlugin])
    realPlugin = p1.load()
    self.assertIs(realPlugin, sys.modules[('mypackage.%s' % (self.originalPlugin,))].TestPlugin)
    import mypackage.testplugin as tp
    self.assertIs(realPlugin, tp.TestPlugin)
