Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
CMFCore.exportimport.tests.test_catalog.importCatalogToolTests Class Reference
Inheritance diagram for CMFCore.exportimport.tests.test_catalog.importCatalogToolTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.exportimport.tests.test_catalog.importCatalogToolTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_empty_purge
def test_empty_update
def test_normal_purge
def test_normal_update

Static Public Attributes

 layer = ExportImportZCMLLayer

Detailed Description

Definition at line 135 of file test_catalog.py.


Member Function Documentation

Definition at line 139 of file test_catalog.py.

00139 
00140     def test_empty_purge(self):
00141         from Products.CMFCore.exportimport.catalog import importCatalogTool
00142 
00143         site = self._initSite(2)
00144         ctool = site.portal_catalog
00145 
00146         self.assertEqual(len(ctool.objectIds()), 1)
00147         self.assertEqual(len(ctool.indexes()), 1)
00148         self.assertEqual(len(ctool.schema()), 1)
00149 
00150         context = DummyImportContext(site, True)
00151         context._files['catalog.xml'] = _EMPTY_EXPORT
00152         importCatalogTool(context)
00153 
00154         self.assertEqual(len(ctool.objectIds()), 0)
00155         self.assertEqual(len(ctool.indexes()), 0)
00156         self.assertEqual(len(ctool.schema()), 0)

Here is the call graph for this function:

Definition at line 157 of file test_catalog.py.

00157 
00158     def test_empty_update(self):
00159         from Products.CMFCore.exportimport.catalog import importCatalogTool
00160 
00161         site = self._initSite(2)
00162         ctool = site.portal_catalog
00163 
00164         self.assertEqual(len(ctool.objectIds()), 1)
00165         self.assertEqual(len(ctool.indexes()), 1)
00166         self.assertEqual(len(ctool.schema()), 1)
00167 
00168         context = DummyImportContext(site, False)
00169         context._files['catalog.xml'] = _EMPTY_EXPORT
00170         importCatalogTool(context)
00171 
00172         self.assertEqual(len(ctool.objectIds()), 1)
00173         self.assertEqual(len(ctool.indexes()), 1)
00174         self.assertEqual(len(ctool.schema()), 1)

Here is the call graph for this function:

Definition at line 175 of file test_catalog.py.

00175 
00176     def test_normal_purge(self):
00177         from Products.CMFCore.exportimport.catalog import exportCatalogTool
00178         from Products.CMFCore.exportimport.catalog import importCatalogTool
00179 
00180         site = self._initSite(2)
00181         ctool = site.portal_catalog
00182 
00183         self.assertEqual(len(ctool.objectIds()), 1)
00184         self.assertEqual(len(ctool.indexes()), 1)
00185         self.assertEqual(len(ctool.schema()), 1)
00186 
00187         context = DummyImportContext(site, True)
00188         context._files['catalog.xml'] = _NORMAL_EXPORT
00189         importCatalogTool(context)
00190 
00191         self.assertEqual(len(ctool.objectIds()), 1)
00192         self.assertEqual(len(ctool.indexes()), 1)
00193         self.assertEqual(len(ctool.schema()), 1)
00194 
00195         # complete the roundtrip
00196         context = DummyExportContext(site)
00197         exportCatalogTool(context)
00198 
00199         self.assertEqual(len(context._wrote), 1)
00200         filename, text, content_type = context._wrote[0]
00201         self.assertEqual(filename, 'catalog.xml')
00202         self._compareDOM(text, _NORMAL_EXPORT)
00203         self.assertEqual(content_type, 'text/xml')

Here is the call graph for this function:

Definition at line 204 of file test_catalog.py.

00204 
00205     def test_normal_update(self):
00206         from Products.CMFCore.exportimport.catalog import importCatalogTool
00207 
00208         site = self._initSite(2)
00209         ctool = site.portal_catalog
00210 
00211         self.assertEqual(len(ctool.objectIds()), 1)
00212         self.assertEqual(len(ctool.indexes()), 1)
00213         self.assertEqual(len(ctool.schema()), 1)
00214 
00215         context = DummyImportContext(site, False)
00216         context._files['catalog.xml'] = _UPDATE_IMPORT
00217         importCatalogTool(context)
00218 
00219         self.assertEqual(len(ctool.objectIds()), 1)
00220         self.assertEqual(len(ctool.indexes()), 2)
00221         self.assertEqual(len(ctool.schema()), 2)
00222 

Here is the call graph for this function:


Member Data Documentation

Definition at line 137 of file test_catalog.py.


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