[Zope3-checkins] CVS: Zope3/lib/python/Zope/TextIndex/tests - testIndex.py:1.2
Guido van Rossum
guido@python.org
Wed, 4 Dec 2002 13:41:57 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/TextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv2196/tests
Modified Files:
testIndex.py
Log Message:
Rename length() to wordCount() (both on index and on lexicon).
Add documentCount() to index.
=== Zope3/lib/python/Zope/TextIndex/tests/testIndex.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/TextIndex/tests/testIndex.py:1.1 Tue Dec 3 09:28:16 2002
+++ Zope3/lib/python/Zope/TextIndex/tests/testIndex.py Wed Dec 4 13:41:56 2002
@@ -38,7 +38,7 @@
self.assertEqual(len(self.index._docwords), 1)
self.assertEqual(len(self.index.get_words(DOCID)), 5)
self.assertEqual(len(self.index._wordinfo),
- self.index.length())
+ self.index.wordCount())
for map in self.index._wordinfo.values():
self.assertEqual(len(map), 1)
self.assert_(map.has_key(DOCID))
@@ -51,7 +51,7 @@
self.assertEqual(len(self.index._wordinfo), 0)
self.assertEqual(len(self.index._docwords), 0)
self.assertEqual(len(self.index._wordinfo),
- self.index.length())
+ self.index.wordCount())
def test_index_two_documents(self):
self.test_index_document()
@@ -64,7 +64,7 @@
self.assertEqual(len(self.index._docwords), 2)
self.assertEqual(len(self.index.get_words(DOCID)), 4)
self.assertEqual(len(self.index._wordinfo),
- self.index.length())
+ self.index.wordCount())
wids = self.lexicon.termToWordIds("document")
self.assertEqual(len(wids), 1)
document_wid = wids[0]
@@ -87,7 +87,7 @@
self.assertEqual(len(self.index._docwords), 1)
self.assertEqual(len(self.index.get_words(DOCID)), 4)
self.assertEqual(len(self.index._wordinfo),
- self.index.length())
+ self.index.wordCount())
for map in self.index._wordinfo.values():
self.assertEqual(len(map), 1)
self.assert_(map.has_key(DOCID))
@@ -100,7 +100,7 @@
self.assertEqual(len(self.index._docwords), 1)
self.assertEqual(len(self.index.get_words(DOCID)), 7)
self.assertEqual(len(self.index._wordinfo),
- self.index.length())
+ self.index.wordCount())
wids = self.lexicon.termToWordIds("repeat")
self.assertEqual(len(wids), 1)
repititive_wid = wids[0]