[Zodb-checkins] CVS: Zope3/lib/python/Persistence/BTrees/tests - testBTrees.py:1.1.2.5
Tim Peters
tim.one@comcast.net
Sun, 9 Jun 2002 15:32:52 -0400
Update of /cvs-repository/Zope3/lib/python/Persistence/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv14784/tests
Modified Files:
Tag: Zope-3x-branch
testBTrees.py
Log Message:
Trimmed trailing whitespace.
=== Zope3/lib/python/Persistence/BTrees/tests/testBTrees.py 1.1.2.4 => 1.1.2.5 ===
# 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 os
import random
@@ -45,7 +45,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]
@@ -153,13 +153,13 @@
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
@@ -227,7 +227,7 @@
k=random.randrange(-2000, 2001)
d[k]=i
l.append((k, i))
-
+
items=d.items()
items.sort()
@@ -247,12 +247,12 @@
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))
@@ -264,7 +264,7 @@
t = self.t
t.insert(5)
self.assertEqual(t.insert(5) , 0)
-
+
def testInsert(self):
t = self.t
t.insert(1)
@@ -333,7 +333,7 @@
k=random.randrange(-2000, 2001)
d[k]=i
l.append(k)
-
+
items=d.keys()
items.sort()
@@ -361,7 +361,7 @@
for x in r: t.insert(x)
for x in r:
self.assertEqual(t[x] , x)
-
+
class BTreeTests(MappingBase):
""" Tests common to all BTrees """
def testDeleteNoChildrenWorks(self):
@@ -399,7 +399,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
@@ -485,7 +485,7 @@
except KeyError:
pass
self.assertEqual(realseq(self.t.keys()) , [], realseq(self.t.keys()))
-
+
def testPathologicalRightBranching(self):
r = range(1000)
for x in r:
@@ -680,7 +680,7 @@
(ExtendedSetTests, (IISet, IOSet, OISet, OOSet)),
(BTreeTests, (IIBTree, IOBTree, OIBTree, OOBTree)),
]
-
+
s = TestSuite()
for base, classes in template:
for klass in classes: