[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TopicIndex/tests - testTopicIndex.py:1.7

Gary Poster gary at zope.com
Wed Dec 31 16:18:05 EST 2003


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TopicIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv32743/TopicIndex/tests

Modified Files:
	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.6 => 1.7 ===
--- Zope/lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py:1.6	Sat Aug 16 12:44:51 2003
+++ Zope/lib/python/Products/PluginIndexes/TopicIndex/tests/testTopicIndex.py	Wed Dec 31 16:18:04 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