Commit 74e88c6d authored by Chris McDonough's avatar Chris McDonough

Added test for nonexistent word.

parent da00c76b
......@@ -371,6 +371,25 @@ class Tests(unittest.TestCase):
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')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment