[Zope-Checkins] CVS: Zope/lib/python/BTrees/tests - testBTrees.py:1.32
Tim Peters
tim.one@comcast.net
Sun, 9 Jun 2002 15:13:30 -0400
Update of /cvs-repository/Zope/lib/python/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv9682
Modified Files:
testBTrees.py
Log Message:
Trimmed trailing whitespace.
=== Zope/lib/python/BTrees/tests/testBTrees.py 1.31 => 1.32 ===
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
import sys, os, time, random
import os, sys
@@ -44,7 +44,7 @@
def _delDB(self):
for file in glob('fs_tmp__*'):
os.remove(file)
-
+
def testLoadAndStore(self):
for i in 0, 10, 1000:
t = self.t.__class__()
@@ -72,7 +72,7 @@
finally:
self._closeDB(root)
self._delDB()
-
+
def testGhostUnghost(self):
for i in 0, 10, 1000:
t = self.t.__class__()
@@ -108,7 +108,7 @@
def _populate(self, t, l):
# Make some data
for i in range(l): t[i]=i
-
+
def testGetItemFails(self):
self.assertRaises(KeyError, self._getitemfail)
@@ -118,7 +118,7 @@
def testGetReturnsDefault(self):
self.assertEqual(self.t.get(1) , None)
self.assertEqual(self.t.get(1, 'foo') , 'foo')
-
+
def testSetItemGetItemWorks(self):
self.t[1] = 1
a = self.t[1]
@@ -154,14 +154,14 @@
def testValuesWorks1(self):
for x in range(100):
- self.t[99-x] = x
+ self.t[99-x] = x
for x in range(40):
lst = list(self.t.values(0+x,99-x))
lst.sort()
self.assertEqual(lst,range(0+x,99-x+1))
-
+
def testKeysWorks(self):
for x in range(100):
self.t[x] = x
@@ -229,7 +229,7 @@
k=random.randrange(-2000, 2001)
d[k]=i
l.append((k, i))
-
+
items=d.items()
items.sort()
@@ -249,13 +249,13 @@
self.assertEqual(list(t.keys(2,4)),[], list(t.keys(2,4)))
self.assertEqual(list(t.keys(6,8)),[], list(t.keys(6,8)))
self.assertEqual(list(t.keys(10,12)),[], list(t.keys(10,12)))
-
+
class NormalSetTests(Base):
""" Test common to all set types """
- def _populate(self, t, l):
+ def _populate(self, t, l):
# Make some data
t.update(range(l))
@@ -268,7 +268,7 @@
t = self.t
t.insert(5)
self.assertEqual(t.insert(5) , 0)
-
+
def testInsert(self):
t = self.t
t.insert(1)
@@ -337,7 +337,7 @@
k=random.randrange(-2000, 2001)
d[k]=i
l.append(k)
-
+
items=d.keys()
items.sort()
@@ -365,7 +365,7 @@
for x in r: t.insert(x)
for x in r:
self.assertEqual(t[x] , x)
-
+
class BucketTests(MappingBase):
""" Tests common to all buckets """
pass
@@ -407,7 +407,7 @@
del self.t[2]
diff = lsubtract(self.t.keys(), [1,3,4,5,6,10])
self.assertEqual(diff , [], diff)
-
+
def testDeleteTwoChildrenInorderSuccessorWorks(self):
""" 7, 3, 8, 1, 5, 10, 6, 4 -- del 3 """
self.t[7] = 6
@@ -493,7 +493,7 @@
except KeyError:
pass
self.assertEqual(realseq(self.t.keys()) , [], realseq(self.t.keys()))
-
+
def testPathologicalRightBranching(self):
r = range(1000)
for x in r:
@@ -704,7 +704,7 @@
class TestIOTreeSets(NormalSetTests, TestCase):
def setUp(self):
self.t = IOTreeSet()
-
+
class TestOOTreeSets(NormalSetTests, TestCase):
def setUp(self):
self.t = OOTreeSet()
@@ -716,7 +716,7 @@
class TestOITreeSets(NormalSetTests, TestCase):
def setUp(self):
self.t = OITreeSet()
-
+
## Bucket tests
class TestIOBuckets(BucketTests, TestCase):