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

Tim Peters tim.one@comcast.net
Sun, 5 May 2002 21:46:26 -0400

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

Modified Files:
      Tag: TextIndexDS9-branch
Log Message:
New method NBest.pop_smallest().  This is key to doing multiple unions
efficiently (which we aren't doing yet).

NBest.getbest():  Rewrite in the obvious way.  When I wrote this, I
believe I was under the illusion that zip() wasn't available in 2.1.

=== Products/ZCTextIndex/tests/testNBest.py => ===
                 self.assertEqual(nb.getbest(), expected)
+                for i in range(1, n+1):
+                    self.assertEqual(nb.pop_smallest(), expected[-i])
+                self.assertRaises(IndexError, nb.pop_smallest)
 def test_suite():
     return makeSuite(NBestTest)