[Zope-Checkins]
CVS: Zope/lib/python/Products/PluginIndexes/TopicIndex/tests
- testTopicIndex.py:1.5.30.2
Gary Poster
gary at zope.com
Wed Dec 31 16:09:25 EST 2003
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TopicIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv29452/tests
Modified Files:
Tag: Zope-2_7-branch
testTopicIndex.py
Log Message:
Fix TopicIndex in two ways:
1) items added to a topic index PythonFilteredSet could never be removed upon a reindex, even if they no longer evaluated to be true. This is fixed.
2) Casey informs me that a IITreeSet is better for this application that an IISet. This should be a transparent change simply by relying on the keys method, which both have, rather than the iterable IISet.
=== Zope/lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py 1.5.30.1 => 1.5.30.2 ===
--- Zope/lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py:1.5.30.1 Thu Sep 18 10:16:15 2003
+++ Zope/lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py Wed Dec 31 16:09:25 2003
@@ -34,7 +34,6 @@
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()
@@ -72,6 +71,11 @@
self._searchAnd('doc2',[3,4])
self._searchAnd(['doc2'],[3,4])
self._searchAnd(['doc1','doc2'],[])
+
+ def testRemoval(self):
+ self.TI.index_object(1, Obj('1','doc2'))
+ self._searchOr('doc1',[2])
+ self._searchOr('doc2', [1,3,4])
def test_suite():
More information about the Zope-Checkins
mailing list