[Zope-CVS] CVS: Products/ZCTextIndex/tests - testIndex.py:1.1.2.4

Jeremy Hylton jeremy@zope.com
Thu, 2 May 2002 12:42:14 -0400


Update of /cvs-repository/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv15019/tests

Modified Files:
      Tag: TextIndexDS9-branch
	testIndex.py 
Log Message:
Add a very short list of stop words (based on Lucene list).

Change the text of documents in testIndex because they contained
stopwords that screwed up the tests.


=== Products/ZCTextIndex/tests/testIndex.py 1.1.2.3 => 1.1.2.4 ===
 
     def test_index_document(self, DOCID=1):
-        doc = Indexable("this doc is simple document")
+        doc = Indexable("simple document contains five words")
         self.index.index_object(DOCID, doc)
         self.assert_(self.index._docweight[DOCID])
         self.assertEqual(len(self.index._wordinfo), 5)
@@ -81,7 +81,7 @@
 
     def test_index_two_documents(self):
         self.test_index_document()
-        doc = MethodIndexable("not the same document")
+        doc = MethodIndexable("another document just four")
         DOCID = 2
         self.index.index_object(DOCID, doc)
         self.assert_(self.index._docweight[DOCID])
@@ -114,13 +114,13 @@
             self.assert_(map.has_key(DOCID))
 
     def test_index_duplicated_words(self, DOCID=1):
-        doc = Indexable("the doc is repetitive repetitive repetitive document")
+        doc = Indexable("very simple repeat repeat repeat document test")
         self.index.index_object(DOCID, doc)
         self.assert_(self.index._docweight[DOCID])
         self.assertEqual(len(self.index._wordinfo), 5)
         self.assertEqual(len(self.index._docwords), 1)
         self.assertEqual(len(self.index._docwords[DOCID]), 5)
-        wids = self.lexicon.termToWordIds("repetitive")
+        wids = self.lexicon.termToWordIds("repeat")
         self.assertEqual(len(wids), 1)
         repititive_wid = wids[0]
         for wid, map in self.index._wordinfo.items():