[Zodb-checkins] CVS: StandaloneZODB/BTrees/tests - testBTrees.py:1.23.8.1 testBTreesUnicode.py:1.5.8.1 testConflict.py:1.10.8.1
Jeremy Hylton
jeremy@zope.com
Tue, 18 Dec 2001 12:04:16 -0500
Update of /cvs-repository/StandaloneZODB/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv28929/BTrees/tests
Modified Files:
Tag: Standby-branch
testBTrees.py testBTreesUnicode.py testConflict.py
Log Message:
Merge StandaloneZODB-1_0-branch into Standby-branch
=== StandaloneZODB/BTrees/tests/testBTrees.py 1.23 => 1.23.8.1 ===
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
-# Copyright (c) 2001 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
-#
-##############################################################################
+# Version 1.1 (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
@@ -48,12 +45,14 @@
for i in 0, 10, 1000:
t = self.t.__class__()
self._populate(t, i)
+ root = None
try:
root = self._getRoot()
root[i] = t
get_transaction().commit()
except:
- self._closeDB(root)
+ if root is not None:
+ self._closeDB(root)
self._delDB()
raise
@@ -735,8 +734,6 @@
return alltests
-
-
## utility functions
def lsubtract(l1, l2):
@@ -749,10 +746,8 @@
def realseq(itemsob):
return map(lambda x: x, itemsob)
-
def main():
TextTestRunner().run(test_suite())
if __name__ == '__main__':
main()
-
=== StandaloneZODB/BTrees/tests/testBTreesUnicode.py 1.5 => 1.5.8.1 ===
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
-# Copyright (c) 2001 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
-#
-##############################################################################
+# Version 1.1 (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.
__version__ = '$Id$'
=== StandaloneZODB/BTrees/tests/testConflict.py 1.10 => 1.10.8.1 ===
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
-# Copyright (c) 2001 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
-#
-##############################################################################
+# Version 1.1 (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
from BTrees.OOBTree import OOBTree, OOBucket, OOSet, OOTreeSet
@@ -40,7 +37,8 @@
root = None
def _delDB(self):
- os.system('rm fs_tmp__*')
+ for fn in glob('rm fs_tmp__*'):
+ os.remove(fn)
class MappingBase(Base):
""" Tests common to mappings (buckets, btrees) """