Back to index

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

List of all members.

Public Member Functions

def setUp
def test_body_get_special
def test_body_set_update

Static Public Attributes

 layer = ExportImportZCMLLayer

Private Member Functions

def _getTargetClass
def _populate
def _populate_special

Private Attributes

 _obj
 _BODY

Detailed Description

Definition at line 116 of file test_exportimport.py.


Member Function Documentation

Definition at line 120 of file test_exportimport.py.

00120 
00121     def _getTargetClass(self):
00122         from Products.GenericSetup.ZCatalog.exportimport \
00123                 import ZCatalogXMLAdapter
00124 
00125         return ZCatalogXMLAdapter

Definition at line 126 of file test_exportimport.py.

00126 
00127     def _populate(self, obj):
00128         from Products.ZCTextIndex.Lexicon import CaseNormalizer
00129         from Products.ZCTextIndex.Lexicon import Splitter
00130         from Products.ZCTextIndex.Lexicon import StopWordRemover
00131         from Products.ZCTextIndex.ZCTextIndex import PLexicon
00132 
00133         obj._setObject('foo_plexicon', PLexicon('foo_plexicon'))
00134         lex = obj.foo_plexicon
00135         lex._pipeline = (Splitter(), CaseNormalizer(), StopWordRemover())
00136 
00137         obj.addIndex('foo_date', 'DateIndex')
00138 
00139         obj.addIndex('foo_daterange', 'DateRangeIndex')
00140         idx = obj._catalog.getIndex('foo_daterange')
00141         idx._edit('bar', 'baz')
00142 
00143         obj.addIndex('foo_field', 'FieldIndex')
00144         idx = obj._catalog.getIndex('foo_field')
00145         idx.indexed_attrs = ('bar',)
00146 
00147         obj.addIndex('foo_keyword', 'KeywordIndex')
00148         idx = obj._catalog.getIndex('foo_keyword')
00149         idx.indexed_attrs = ('bar',)
00150 
00151         obj.addIndex('foo_path', 'PathIndex')
00152 
00153         obj.addIndex('foo_topic', 'TopicIndex')
00154         idx = obj._catalog.getIndex('foo_topic')
00155         idx.addFilteredSet('bar', 'PythonFilteredSet', 'True')
00156         idx.addFilteredSet('baz', 'PythonFilteredSet', 'False')
00157 
00158         extra = _extra()
00159         extra.lexicon_id = 'foo_plexicon'
00160         extra.index_type = 'Okapi BM25 Rank'
00161         obj.addIndex('foo_zctext', 'ZCTextIndex', extra)
00162 
00163         obj.addColumn('spam')
00164         obj.addColumn('eggs')

Here is the caller graph for this function:

Definition at line 165 of file test_exportimport.py.

00165 
00166     def _populate_special(self, obj):
00167         from Products.PluginIndexes.TextIndex.Vocabulary import Vocabulary
00168 
00169         self._populate(self._obj)
00170         obj._setObject('foo_vocabulary', Vocabulary('foo_vocabulary'))
00171         obj.addIndex('foo_text', 'TextIndex')
00172         obj.addColumn('bacon')

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 173 of file test_exportimport.py.

00173 
00174     def setUp(self):
00175         from Products.ZCatalog.ZCatalog import ZCatalog
00176 
00177         BodyAdapterTestCase.setUp(self)
00178         self._obj = ZCatalog('foo_catalog')
00179         self._BODY = _CATALOG_BODY % ('', '', '')

Definition at line 180 of file test_exportimport.py.

00180 
00181     def test_body_get_special(self):
00182         # Assert that the catalog starts out the way we expect it to.
00183         self._populate_special(self._obj)
00184         context = DummySetupEnviron()
00185         adapted = getMultiAdapter((self._obj, context), IBody)
00186         self.assertEqual(adapted.body,
00187                          _CATALOG_BODY % (_VOCABULARY_XML, _TEXT_XML, _COLUMN_XML))

Here is the call graph for this function:

Definition at line 188 of file test_exportimport.py.

00188 
00189     def test_body_set_update(self):
00190         # Assert that the catalog ends up the way we expect it to.
00191         self._populate_special(self._obj)
00192         context = DummySetupEnviron()
00193         context._should_purge = False
00194         adapted = getMultiAdapter((self._obj, context), IBody)
00195         adapted.body = _CATALOG_UPDATE_BODY
00196         self.assertEqual(adapted.body, _CATALOG_BODY % ('', _ZCTEXT_XML, ''))
00197 

Here is the call graph for this function:


Member Data Documentation

Definition at line 178 of file test_exportimport.py.

Definition at line 177 of file test_exportimport.py.

Definition at line 118 of file test_exportimport.py.


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