[Zope-Checkins] CVS: Zope2 - testUnTextIndex.py:1.5
chrism@serenade.digicool.com
chrism@serenade.digicool.com
Mon, 2 Apr 2001 14:20:36 -0400
Update of /cvs-repository/Zope2/lib/python/SearchIndex/tests
In directory serenade.digicool.com:/home/chrism/sandboxes/TrunkBranch/lib/python/SearchIndex/tests
Modified Files:
testUnTextIndex.py
Log Message:
Added test for nonexistent word.
--- Updated File testUnTextIndex.py in package Zope2 --
--- testUnTextIndex.py 2001/03/22 19:21:07 1.4
+++ testUnTextIndex.py 2001/04/02 18:20:35 1.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')