[Zodb-checkins] CVS: Zope/lib/python/BTrees/tests - testBTrees.py:1.44
Tim Peters
tim.one@comcast.net
Wed, 19 Jun 2002 19:44:21 -0400
Update of /cvs-repository/Zope/lib/python/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv8446/tests
Modified Files:
testBTrees.py
Log Message:
BTrees and TreeSets have a new ._check() method. This does a thorough job
of verifying that BTree invariants are satisfied, raising AssertionError
if they're not. Nothing calls this method by magic; it's for debugging.
=== Zope/lib/python/BTrees/tests/testBTrees.py 1.43 => 1.44 ===
class BTreeTests(MappingBase):
""" Tests common to all BTrees """
+
+ def tearDown(self):
+ self.t._check()
+ MappingBase.tearDown(self)
+
def testDeleteNoChildrenWorks(self):
self.t[5] = 6
self.t[2] = 10
@@ -953,6 +958,7 @@
# One more.
t = ts()
t.__setstate__(((tree13, 4, tree5711), bucket1))
+ t._check()
return t, [1, 3, 5, 7, 11]
def testDegenerateBasicOps(self):
@@ -1013,6 +1019,7 @@
for key in oneperm:
t.remove(key)
keys.remove(key)
+ t._check()
self._checkRanges(t, keys)
# We removed all the keys, so the tree should be empty now.
self.assertEqual(t.__getstate__(), None)