[Zope3-checkins] CVS: Zope3/lib/python/Zope/TextIndex/tests - testTextIndexWrapper.py:1.4
Guido van Rossum
guido@python.org
Thu, 5 Dec 2002 09:39:13 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/TextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv15537/tests
Modified Files:
testTextIndexWrapper.py
Log Message:
Fix stupid copy/paste bug in wordCount().
Add unit tests for wordCount() and documentCount().
=== Zope3/lib/python/Zope/TextIndex/tests/testTextIndexWrapper.py 1.3 => 1.4 ===
--- Zope3/lib/python/Zope/TextIndex/tests/testTextIndexWrapper.py:1.3 Thu Dec 5 07:41:09 2002
+++ Zope3/lib/python/Zope/TextIndex/tests/testTextIndexWrapper.py Thu Dec 5 09:39:12 2002
@@ -31,6 +31,15 @@
w.index_doc(1001, [doc])
self.wrapper = w
+ def testCounts(self):
+ w = self.wrapper
+ self.assertEqual(self.wrapper.documentCount(), 2)
+ self.assertEqual(self.wrapper.wordCount(), 12)
+ doc = u"foo bar"
+ w.index_doc(1002, [doc])
+ self.assertEqual(self.wrapper.documentCount(), 3)
+ self.assertEqual(self.wrapper.wordCount(), 14)
+
def testOne(self):
matches, total = self.wrapper.query(u"quick fox", 0, 10)
self.assertEqual(total, 1)