Commit fb4df500 authored by Barry Warsaw's avatar Barry Warsaw

check*() -> test*()

Also, set the FullOpenCloseTest's level to 2 so
testCloseWithCheckpointingThread() isn't normally run, even if you
have BerkeleyDB installed.  This is the single longest test in the
--all suite.  This shaves about 21 seconds off the tests.
parent 18fb7580
...@@ -28,7 +28,7 @@ from BDBStorage.tests import BerkeleyTestBase ...@@ -28,7 +28,7 @@ from BDBStorage.tests import BerkeleyTestBase
class TestMixin: class TestMixin:
def checkDBHomeExists(self): def testDBHomeExists(self):
self.failUnless(os.path.isdir(BerkeleyTestBase.DBHOME)) self.failUnless(os.path.isdir(BerkeleyTestBase.DBHOME))
...@@ -42,7 +42,7 @@ class FullCreateTest(BerkeleyTestBase.FullTestBase, TestMixin): ...@@ -42,7 +42,7 @@ class FullCreateTest(BerkeleyTestBase.FullTestBase, TestMixin):
class FullOpenExistingTest(BerkeleyTestBase.FullTestBase): class FullOpenExistingTest(BerkeleyTestBase.FullTestBase):
def checkOpenWithExistingVersions(self): def testOpenWithExistingVersions(self):
version = 'test-version' version = 'test-version'
oid = self._storage.new_oid() oid = self._storage.new_oid()
revid = self._dostore(oid, data=7, version=version) revid = self._dostore(oid, data=7, version=version)
...@@ -51,7 +51,7 @@ class FullOpenExistingTest(BerkeleyTestBase.FullTestBase): ...@@ -51,7 +51,7 @@ class FullOpenExistingTest(BerkeleyTestBase.FullTestBase):
self._storage = self.ConcreteStorage(BerkeleyTestBase.DBHOME) self._storage = self.ConcreteStorage(BerkeleyTestBase.DBHOME)
self.assertEqual(self._storage.modifiedInVersion(oid), version) self.assertEqual(self._storage.modifiedInVersion(oid), version)
def checkOpenAddVersion(self): def testOpenAddVersion(self):
eq = self.assertEqual eq = self.assertEqual
version1 = 'test-version' version1 = 'test-version'
oid1 = self._storage.new_oid() oid1 = self._storage.new_oid()
...@@ -74,6 +74,8 @@ class FullOpenExistingTest(BerkeleyTestBase.FullTestBase): ...@@ -74,6 +74,8 @@ class FullOpenExistingTest(BerkeleyTestBase.FullTestBase):
class FullOpenCloseTest(BerkeleyTestBase.FullTestBase): class FullOpenCloseTest(BerkeleyTestBase.FullTestBase):
level = 2
def _mk_dbhome(self, dir): def _mk_dbhome(self, dir):
config = BerkeleyConfig config = BerkeleyConfig
config.interval = 10 config.interval = 10
...@@ -84,7 +86,7 @@ class FullOpenCloseTest(BerkeleyTestBase.FullTestBase): ...@@ -84,7 +86,7 @@ class FullOpenCloseTest(BerkeleyTestBase.FullTestBase):
self._zap_dbhome(dir) self._zap_dbhome(dir)
raise raise
def checkCloseWithCheckpointingThread(self): def testCloseWithCheckpointingThread(self):
# All the interesting stuff happens in the setUp and tearDown # All the interesting stuff happens in the setUp and tearDown
time.sleep(20) time.sleep(20)
...@@ -94,7 +96,7 @@ class OpenRecoveryTest(BerkeleyTestBase.FullTestBase): ...@@ -94,7 +96,7 @@ class OpenRecoveryTest(BerkeleyTestBase.FullTestBase):
def _mk_dbhome(self, dir): def _mk_dbhome(self, dir):
self._dir = dir self._dir = dir
def checkOpenWithBogusConfig(self): def testOpenWithBogusConfig(self):
class C: pass class C: pass
c = C() c = C()
# This instance won't have the necessary attributes, so the creation # This instance won't have the necessary attributes, so the creation
...@@ -110,11 +112,11 @@ class OpenRecoveryTest(BerkeleyTestBase.FullTestBase): ...@@ -110,11 +112,11 @@ class OpenRecoveryTest(BerkeleyTestBase.FullTestBase):
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
if BDBStorage.is_available: if BDBStorage.is_available:
suite.addTest(unittest.makeSuite(MinimalCreateTest, 'check')) suite.addTest(unittest.makeSuite(MinimalCreateTest))
suite.addTest(unittest.makeSuite(FullCreateTest, 'check')) suite.addTest(unittest.makeSuite(FullCreateTest))
suite.addTest(unittest.makeSuite(FullOpenExistingTest, 'check')) suite.addTest(unittest.makeSuite(FullOpenExistingTest))
suite.addTest(unittest.makeSuite(FullOpenCloseTest, 'check')) suite.addTest(unittest.makeSuite(FullOpenCloseTest))
suite.addTest(unittest.makeSuite(OpenRecoveryTest, 'check')) suite.addTest(unittest.makeSuite(OpenRecoveryTest))
return suite return suite
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment