Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions | Static Private Attributes
AdvancedQuery.tests.TestBase.TestCase Class Reference
Inheritance diagram for AdvancedQuery.tests.TestBase.TestCase:
Inheritance graph
[legend]
Collaboration diagram for AdvancedQuery.tests.TestBase.TestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp

Public Attributes

 catalog

Private Member Functions

def _addObject
def _checkQuery
def _check

Static Private Attributes

string _indexType = 'Managable FieldIndex'
int _ReverseOrder = 0
int _stringType = 0

Detailed Description

Definition at line 21 of file TestBase.py.


Member Function Documentation

def AdvancedQuery.tests.TestBase.TestCase._addObject (   self,
  dest,
  id,
  a1,
  a2 
) [private]

Definition at line 47 of file TestBase.py.

00047 
00048   def _addObject(self, dest, id, a1, a2):
00049     id = `id`
00050     setattr(dest, id, _Object(id, a1, a2)); obj = getattr(dest, id)
00051     obj.indexObject()

Here is the caller graph for this function:

def AdvancedQuery.tests.TestBase.TestCase._check (   self,
  result,
  should,
  order = True 
) [private]

Definition at line 60 of file TestBase.py.

00060 
00061   def _check(self, result, should, order=True):
00062     c = self.catalog._catalog
00063     ids = [c.paths[r.data_record_id_] for r in result]
00064     if order: ids.sort()
00065     self.assertEqual(''.join(ids), should)
00066 
00067 

Here is the caller graph for this function:

def AdvancedQuery.tests.TestBase.TestCase._checkQuery (   self,
  query,
  should 
) [private]
check that the result *query* equals *should*.

*should* is a sequence of digits (representing ids).

Definition at line 52 of file TestBase.py.

00052 
00053   def _checkQuery(self, query, should):
00054     '''check that the result *query* equals *should*.
00055 
00056     *should* is a sequence of digits (representing ids).
00057     '''
00058     C = self.catalog
00059     return self._check(C.evalAdvancedQuery(query), should)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 26 of file TestBase.py.

00026 
00027   def afterSetUp(self):
00028     folder = self.folder
00029     folder.manage_addProduct['ZCatalog'].manage_addZCatalog('Catalog','')
00030     catalog = self.catalog = folder.Catalog
00031     catalog.manage_addIndex('I1', self._indexType)
00032     catalog.manage_addIndex('I2', self._indexType)
00033     if self._ReverseOrder:
00034       indexes = catalog._catalog.indexes
00035       idx = indexes['I1']; idx.ReverseOrder = 1; idx.clear()
00036       idx = indexes['I2']; idx.ReverseOrder = 1; idx.clear()
00037     if self._stringType:
00038       indexes = catalog._catalog.indexes
00039       idx = indexes['I1']; idx.TermType = 'string'; idx.clear()
00040       idx = indexes['I2']; idx.TermType = 'string'; idx.clear()
00041     self._addObject(folder, 1, 'a', 'A')
00042     self._addObject(folder, 2, 'b', 'A')
00043     self._addObject(folder, 3, 'a', 'B')
00044     self._addObject(folder, 4, 'b', 'B')
00045     self._addObject(folder, 5, None, 'A')
00046     self._addObject(folder, 6, 'c', None)

Here is the call graph for this function:


Member Data Documentation

string AdvancedQuery.tests.TestBase.TestCase._indexType = 'Managable FieldIndex' [static, private]

Definition at line 22 of file TestBase.py.

Definition at line 23 of file TestBase.py.

Definition at line 24 of file TestBase.py.

Definition at line 29 of file TestBase.py.


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