[Zodb-checkins] CVS: ZODB3/bsddb3Storage/bsddb3Storage/tests - test_create.py:1.12
Barry Warsaw
barry@wooz.org
Tue, 19 Nov 2002 15:36:43 -0500
Update of /cvs-repository/ZODB3/bsddb3Storage/bsddb3Storage/tests
In directory cvs.zope.org:/tmp/cvs-serv1731
Modified Files:
test_create.py
Log Message:
Because FullTestBase and MinimalTestBase both already inherit from
BerkeleyTestBase, one of the base classes is superfluous.
FullOpenCloseTest: New class to make sure that the checkpointing
thread gets properly shutdown.
=== ZODB3/bsddb3Storage/bsddb3Storage/tests/test_create.py 1.11 => 1.12 ===
--- ZODB3/bsddb3Storage/bsddb3Storage/tests/test_create.py:1.11 Mon Feb 11 18:40:43 2002
+++ ZODB3/bsddb3Storage/bsddb3Storage/tests/test_create.py Tue Nov 19 15:36:43 2002
@@ -15,8 +15,10 @@
# Unit test for database creation
import os
+import time
import unittest
import BerkeleyTestBase
+from bsddb3Storage.BerkeleyBase import BerkeleyConfig
@@ -25,21 +27,16 @@
self.failUnless(os.path.isdir(BerkeleyTestBase.DBHOME))
-class MinimalCreateTest(BerkeleyTestBase.BerkeleyTestBase,
- BerkeleyTestBase.MinimalTestBase,
- TestMixin):
+class MinimalCreateTest(BerkeleyTestBase.MinimalTestBase, TestMixin):
pass
-class FullCreateTest(BerkeleyTestBase.BerkeleyTestBase,
- BerkeleyTestBase.FullTestBase,
- TestMixin):
+class FullCreateTest(BerkeleyTestBase.FullTestBase, TestMixin):
pass
-class FullOpenExistingTest(BerkeleyTestBase.BerkeleyTestBase,
- BerkeleyTestBase.FullTestBase):
+class FullOpenExistingTest(BerkeleyTestBase.FullTestBase):
def checkOpenWithExistingVersions(self):
version = 'test-version'
oid = self._storage.new_oid()
@@ -71,11 +68,29 @@
+class FullOpenCloseTest(BerkeleyTestBase.FullTestBase):
+ def _mk_dbhome(self, dir):
+ config = BerkeleyConfig
+ config.interval = 10
+ os.mkdir(dir)
+ try:
+ return self.ConcreteStorage(dir, config=config)
+ except:
+ self._zap_dbhome(dir)
+ raise
+
+ def checkCloseWithCheckpointingThread(self):
+ # All the interesting stuff happens in the setUp and tearDown
+ time.sleep(20)
+
+
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(MinimalCreateTest, 'check'))
suite.addTest(unittest.makeSuite(FullCreateTest, 'check'))
suite.addTest(unittest.makeSuite(FullOpenExistingTest, 'check'))
+ suite.addTest(unittest.makeSuite(FullOpenCloseTest, 'check'))
return suite