[Zope-Checkins] CVS: Zope2 - testUnTextIndex.py:1.1.4.5

chrism@serenade.digicool.com chrism@serenade.digicool.com
Mon, 2 Apr 2001 14:21:00 -0400


Update of /cvs-repository/Zope2/lib/python/SearchIndex/tests
In directory serenade.digicool.com:/home/chrism/sandboxes/2_3Branch/lib/python/SearchIndex/tests

Modified Files:
      Tag: zope-2_3-branch
	testUnTextIndex.py 
Log Message:
Added test for nonexistent word.


--- Updated File testUnTextIndex.py in package Zope2 --
--- testUnTextIndex.py	2001/03/22 19:20:23	1.1.4.4
+++ testUnTextIndex.py	2001/04/02 18:20:59	1.1.4.5
@@ -371,6 +371,25 @@
        r=list(r[0].keys())
        assert  r == [0], r
 
+   def checkNonExistentWord(self):
+       """ Check for nonexistent word """
+       index=self.dbopen()
+       index._lexicon = SearchIndex.GlobbingLexicon.GlobbingLexicon()
+
+       for i in range(len(self.sample_texts)):
+           self.doc.text=self.sample_texts[i]
+           index.index_object(i, self.doc)
+           get_transaction().commit()
+
+       self.dbclose()
+
+       index=self.dbopen()
+
+       r = index._apply_index({'text':'zop'})
+       r=list(r[0].keys())
+       assert  r == [], r
+       
+
 def test_suite():
    return unittest.makeSuite(Tests, 'check')