[Zope-Checkins]
CVS: Zope/lib/python/Products/PluginIndexes/TopicIndex/tests
- testTopicIndex.py:1.5.36.1
Andreas Jung
andreas at andreas-jung.com
Fri Aug 15 12:20:54 EDT 2003
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TopicIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv24762/TopicIndex/tests
Modified Files:
Tag: ajung-indexes-btrees-length-branch
testTopicIndex.py
Log Message:
some cleanup
=== Zope/lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py 1.5 => 1.5.36.1 ===
--- Zope/lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py:1.5 Thu Nov 28 11:32:02 2002
+++ Zope/lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py Fri Aug 15 11:20:50 2003
@@ -11,23 +11,20 @@
#
##############################################################################
+import os ,sys, re, unittest
import ZODB
-import os,sys,re,unittest
from Products.PluginIndexes.TopicIndex.TopicIndex import TopicIndex
-
class Obj:
def __init__(self,id,meta_type=''):
- self.id = id
+ self.id = id
self.meta_type = meta_type
def getId(self): return self.id
def getPhysicalPath(self): return self.id
-
-
class TestBase(unittest.TestCase):
def _searchAnd(self,query,expected):
@@ -36,19 +33,15 @@
def _searchOr(self,query,expected):
return self._search(query,'or',expected)
-
def _search(self,query,operator,expected):
res = self.TI._apply_index({'topic':{'query':query,'operator':operator}})
rows = list(res[0])
rows.sort()
expected.sort()
-
self.assertEqual(rows,expected,query)
-
return rows
-
class TestTopicIndex(TestBase):
def setUp(self):
@@ -66,7 +59,6 @@
def testOr(self):
-
self._searchOr('doc1',[1,2])
self._searchOr(['doc1'],[1,2])
self._searchOr('doc2',[3,4]),
@@ -75,14 +67,11 @@
def testAnd(self):
-
self._searchAnd('doc1',[1,2])
self._searchAnd(['doc1'],[1,2])
self._searchAnd('doc2',[3,4])
self._searchAnd(['doc2'],[3,4])
self._searchAnd(['doc1','doc2'],[])
-
-
def test_suite():
More information about the Zope-Checkins
mailing list