Back to index

plone3  3.1.7
Private Member Functions
PluginRegistry.tests.test_exportimport._TestBase Class Reference
Inheritance diagram for PluginRegistry.tests.test_exportimport._TestBase:
Inheritance graph
[legend]
Collaboration diagram for PluginRegistry.tests.test_exportimport._TestBase:
Collaboration graph
[legend]

List of all members.

Private Member Functions

def _initRegistry

Detailed Description

Definition at line 116 of file test_exportimport.py.


Member Function Documentation

def PluginRegistry.tests.test_exportimport._TestBase._initRegistry (   self,
  plugin_type_info = (),
  plugins = {} 
) [private]

Definition at line 118 of file test_exportimport.py.

00118 
00119         def _initRegistry(self, plugin_type_info=(), plugins={}):
00120             from OFS.Folder import Folder
00121             from OFS.SimpleItem import SimpleItem
00122             from Products.PluginRegistry.PluginRegistry import PluginRegistry
00123 
00124             app = Folder()
00125             app.getPhysicalPath = lambda: ()
00126             app.getPhysicalRoot = lambda: app
00127 
00128             app._setObject('foo_plugin_1', SimpleItem())
00129             app._setObject('foo_plugin_2', SimpleItem())
00130 
00131             registry = PluginRegistry(plugin_type_info)
00132             registry._plugins = {} # it is usually lazy
00133 
00134             for plugin_type, registered in plugins.items():
00135                 for obj_id in registered:
00136                     obj = app._getOb(obj_id)
00137                     directlyProvides(obj, plugin_type)
00138                 registry._plugins[plugin_type] = registered
00139 
00140             app._setObject('plugin_registry', registry)
00141             registry = app._getOb('plugin_registry')
00142             return app, registry
00143 
    class PluginRegistryExporterTests(_TestBase):

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: