[Zodb-checkins] CVS: Zope/lib/python/BTrees/tests - testBTrees.py:1.28

Jim Fulton jim@zope.com
Tue, 28 May 2002 18:15:26 -0400


Update of /cvs-repository/Zope/lib/python/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv3856/tests

Modified Files:
	testBTrees.py 
Log Message:
Fixed a bug that caused BTree item iteration to sometimes fail when
keys at the beginning of the BTree were deleted.


=== Zope/lib/python/BTrees/tests/testBTrees.py 1.27 => 1.28 ===
         self.t[None] = 1
 
+    def testEmptyFirstBucketReportedByGuido(self):
+        b = self.t
+        for i in xrange(29972): # reduce to 29971 and it works
+            b[i] = i
+        for i in xrange(30): # reduce to 29 and it works
+            del b[i]
+            b[i+40000] = i
+
+        self.assertEqual(b.keys()[0], 30)
+
 class TestOOBTrees(BTreeTests, TestCase):
     def setUp(self):
         self.t = OOBTree()