[Zope3-checkins] SVN: Zope3/trunk/src/zope/index/text/te Added clear

Jim Fulton jim at zope.com
Sun Aug 29 16:55:38 EDT 2004


Log message for revision 27342:
  Added clear
  


Changed:
  U   Zope3/trunk/src/zope/index/text/tests/test_textindexwrapper.py
  U   Zope3/trunk/src/zope/index/text/textindexwrapper.py


-=-
Modified: Zope3/trunk/src/zope/index/text/tests/test_textindexwrapper.py
===================================================================
--- Zope3/trunk/src/zope/index/text/tests/test_textindexwrapper.py	2004-08-29 20:55:30 UTC (rev 27341)
+++ Zope3/trunk/src/zope/index/text/tests/test_textindexwrapper.py	2004-08-29 20:55:38 UTC (rev 27342)
@@ -31,6 +31,11 @@
         w.index_doc(1001, [doc])
         self.wrapper = w
 
+    def test_clear(self):
+        self.wrapper.clear()
+        self.assertEqual(self.wrapper.documentCount(), 0)
+        self.assertEqual(self.wrapper.wordCount(), 0)
+
     def testCounts(self):
         w = self.wrapper
         self.assertEqual(self.wrapper.documentCount(), 2)

Modified: Zope3/trunk/src/zope/index/text/textindexwrapper.py
===================================================================
--- Zope3/trunk/src/zope/index/text/textindexwrapper.py	2004-08-29 20:55:30 UTC (rev 27341)
+++ Zope3/trunk/src/zope/index/text/textindexwrapper.py	2004-08-29 20:55:38 UTC (rev 27342)
@@ -53,6 +53,9 @@
     def unindex_doc(self, docid):
         self.index.unindex_doc(docid)
 
+    def clear(self):
+        self.index.clear()
+
     # Methods implementing IQuerying
 
     def query(self, querytext, start=0, count=None):



More information about the Zope3-Checkins mailing list