Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
GenericSetup.tests.test_components.ComponentRegistryXMLAdapterTests Class Reference
Inheritance diagram for GenericSetup.tests.test_components.ComponentRegistryXMLAdapterTests:
Inheritance graph
[legend]
Collaboration diagram for GenericSetup.tests.test_components.ComponentRegistryXMLAdapterTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def tearDown

Static Public Attributes

 layer = ExportImportZCMLLayer

Private Member Functions

def _getTargetClass
def _populate
def _verifyImport

Private Attributes

 _obj
 _BODY

Detailed Description

Definition at line 118 of file test_components.py.


Member Function Documentation

Definition at line 122 of file test_components.py.

00122 
00123     def _getTargetClass(self):
00124         from Products.GenericSetup.components import \
00125             ComponentRegistryXMLAdapter
00126         return ComponentRegistryXMLAdapter

Definition at line 127 of file test_components.py.

00127 
00128     def _populate(self, obj):
00129         obj.registerUtility(DummyUtility(), IDummyInterface)
00130         obj.registerUtility(DummyUtility(), IDummyInterface, name=u'foo')
00131 
00132         tool = aq_base(obj.aq_parent['dummy_tool'])
00133         obj.registerUtility(tool, IDummyInterface, name=u'dummy tool name')
00134 
00135         tool2 = aq_base(obj.aq_parent['dummy_tool2'])
00136         obj.registerUtility(tool2, IDummyInterface, name=u'dummy tool name2')

Here is the caller graph for this function:

Definition at line 137 of file test_components.py.

00137 
00138     def _verifyImport(self, obj):
00139         util = queryUtility(IDummyInterface, name=u'foo')
00140         self.failUnless(IDummyInterface.providedBy(util))
00141         self.failUnless(util.verify())
00142 
00143         util = queryUtility(IDummyInterface)
00144         self.failUnless(IDummyInterface.providedBy(util))
00145         self.failUnless(util.verify())
00146 
00147         util = queryUtility(IDummyInterface, name='dummy tool name')
00148         self.failUnless(IDummyInterface.providedBy(util))
00149         self.failUnless(util.verify())
00150         self.assertEqual(util.meta_type, 'dummy tool')
00151 
00152         # make sure we can get the tool by normal means
00153         tool = getattr(obj.aq_parent, 'dummy_tool')
00154         self.assertEqual(tool.meta_type, 'dummy tool')
00155         self.assertEquals(repr(aq_base(util)), repr(aq_base(tool)))
00156 
00157         util = queryUtility(IDummyInterface, name='dummy tool name2')
00158         self.failUnless(IDummyInterface.providedBy(util))
00159         self.failUnless(util.verify())
00160         self.assertEqual(util.meta_type, 'dummy tool2')
00161 
00162         # make sure we can get the tool by normal means
00163         tool = getattr(obj.aq_parent, 'dummy_tool2')
00164         self.assertEqual(tool.meta_type, 'dummy tool2')
00165         self.assertEquals(repr(aq_base(util)), repr(aq_base(tool)))

Definition at line 166 of file test_components.py.

00166 
00167     def setUp(self):
00168         # Create and enable a local component registry
00169         site = Folder()
00170         createComponentRegistry(site)
00171         setHooks()
00172         setSite(site)
00173         sm = getSiteManager()
00174 
00175         tool = DummyTool()
00176         site._setObject(tool.id, tool)
00177 
00178         tool2 = DummyTool2()
00179         site._setObject(tool2.id, tool2)
00180 
00181         self._obj = sm
00182         self._BODY = _COMPONENTS_BODY

Here is the call graph for this function:

Definition at line 183 of file test_components.py.

00183 
00184     def tearDown(self):
00185         clearSite()


Member Data Documentation

Definition at line 181 of file test_components.py.

Definition at line 180 of file test_components.py.

Definition at line 120 of file test_components.py.


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