Back to index

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

List of all members.

Public Member Functions

def test_parseXML_empty
def test_parseXML_normal_no_plugins
def test_parseXML_normal_with_plugins

Private Member Functions

def _getTargetClass

Detailed Description

Definition at line 234 of file test_exportimport.py.


Member Function Documentation

Definition at line 236 of file test_exportimport.py.

00236 
00237         def _getTargetClass(self):
00238             from Products.PluginRegistry.exportimport \
00239                 import PluginRegistryImporter
00240             return PluginRegistryImporter

Definition at line 241 of file test_exportimport.py.

00241 
00242         def test_parseXML_empty(self):
00243 
00244             app, registry = self._initRegistry()
00245             importer = self._makeOne(registry).__of__(registry)
00246             reg_info = importer.parseXML(_EMPTY_PLUGINREGISTRY_EXPORT)
00247 
00248             self.assertEqual( len( reg_info['plugin_types'] ), 0 )

Definition at line 249 of file test_exportimport.py.

00249 
00250         def test_parseXML_normal_no_plugins(self):
00251 
00252             app, registry = self._initRegistry()
00253             importer = self._makeOne(registry).__of__(registry)
00254             reg_info = importer.parseXML(_NO_PLUGINS_PLUGINREGISTRY_EXPORT)
00255 
00256             self.assertEqual( len( reg_info['plugin_types'] ), 2 )
00257 
00258             info = reg_info['plugin_types'][0]
00259             self.assertEqual(info['id'], 'IFoo')
00260             self.assertEqual(info['interface'], _getDottedName(IFoo))
00261             self.assertEqual(info['title'], 'foo')
00262             self.assertEqual(info['description'], 'Some plugin interface')
00263             self.assertEqual(len( info['plugins'] ), 0)
00264 
00265             info = reg_info['plugin_types'][1]
00266             self.assertEqual(info['id'], 'IBar')
00267             self.assertEqual(info['interface'], _getDottedName(IBar))
00268             self.assertEqual(info['title'], 'bar')
00269             self.assertEqual(info['description'], 'Another plugin interface')
00270             self.assertEqual(len( info['plugins'] ), 0 )

Definition at line 271 of file test_exportimport.py.

00271 
00272         def test_parseXML_normal_with_plugins(self):
00273 
00274             app, registry = self._initRegistry()
00275             importer = self._makeOne(registry).__of__(registry)
00276             reg_info = importer.parseXML(_NORMAL_PLUGINREGISTRY_EXPORT)
00277 
00278             self.assertEqual(len(reg_info['plugin_types'] ), 2 )
00279 
00280             info = reg_info['plugin_types'][0]
00281             self.assertEqual(info['id'], 'IFoo')
00282             self.assertEqual(info['interface'], _getDottedName(IFoo))
00283             self.assertEqual(info['title'], 'foo')
00284             self.assertEqual(info['description'], 'Some plugin interface')
00285             plugins = info['plugins']
00286             self.assertEqual(len(plugins), 2)
00287             self.assertEqual(plugins[0]['id'], 'foo_plugin_1')
00288             self.assertEqual(plugins[1]['id'], 'foo_plugin_2')
00289 
00290             info = reg_info['plugin_types'][1]
00291             self.assertEqual(info['id'], 'IBar')
00292             self.assertEqual(info['interface'], _getDottedName(IBar))
00293             self.assertEqual(info['title'], 'bar')
00294             self.assertEqual(info['description'], 'Another plugin interface')
00295             self.assertEqual(len(info['plugins']), 0 )
00296 
    class Test_importPluginRegistry(_TestBase):

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