[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndexNG/tests - testLexiconNG.py:1.1.2.4

Andreas Jung andreas@digicool.com
Sun, 17 Mar 2002 20:23:52 -0500


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndexNG/tests
In directory cvs.zope.org:/tmp/cvs-serv17753/tests

Modified Files:
      Tag: ajung-textindexng-branch
	testLexiconNG.py 
Log Message:
adjusted tests to new LexiconNG


=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/tests/testLexiconNG.py 1.1.2.3 => 1.1.2.4 ===
 
         self.assertEqual(len(self._lexicon),0)
-        
-        wids = {}
-        for w in words:
-            wids[w] = self._lexicon.getWordId(w)
-
-        self.assertEqual(len(self._lexicon),len(wids))
-
-        for w in words:
-            wids[w] = self._lexicon.getWordId(w)
-        self.assertEqual(len(self._lexicon),len(wids))
-
-
-        for word,wid in wids.items():
-            self.assertEqual(self._lexicon.getWord(wid), word)
-            self.assertEqual(self._lexicon.getWordId(word), wid)
+        wids = self._lexicon.getWordIdList(words)
 
 
     def testASCII(self):
@@ -67,21 +53,8 @@
                  ' auf einen alle Flugplätze der Taliban zerstört worden',
                  'latin1')
 
-        wids = {} 
-        for w in s.split(): 
-            wids[w] = self._lexicon.getWordId(w)
-
-        s = 'the quick brown fox jumps over the lazy dog'
-        for w in s.split(): 
-            wids[w] = self._lexicon.getWordId(w)
-        
-
-        for word,wid in wids.items():
-            self.assertEqual(wid, self._lexicon.getWordId(word))
-
-        for word,wid in self._lexicon._lexicon.items():
-            self.assertEqual(wid, wids.get(word))
-
+        self.doTest(s)
+        return
 
 
     def printLexicon(self):