[Zodb-checkins] CVS: Packages/bsddb3Storage - test_create.py:1.4
barry@digicool.com
barry@digicool.com
Mon, 2 Apr 2001 19:09:03 -0400 (EDT)
Update of /cvs-repository/Packages/bsddb3Storage/test
In directory korak:/tmp/cvs-serv28045
Modified Files:
test_create.py
Log Message:
Factor out commonality between the Minimal and Full tests.
--- Updated File test_create.py in package Packages/bsddb3Storage --
--- test_create.py 2001/03/30 19:45:01 1.3
+++ test_create.py 2001/04/02 23:09:02 1.4
@@ -6,16 +6,15 @@
-class MinimalBaseFramework(unittest.TestCase):
+class BaseFramework(unittest.TestCase):
def setUp(self):
- import Minimal
from ZODB import DB
self._dbhome = 'test-db'
os.mkdir(self._dbhome)
try:
- self._storage = Minimal.Minimal(self._dbhome)
+ self._storage = self.ConcreteStorage(self._dbhome)
self._db = DB(self._storage)
self._conn = self._db.open()
self._root = self._conn.root()
@@ -27,44 +26,28 @@
for file in os.listdir(self._dbhome):
os.unlink(os.path.join(self._dbhome, file))
os.removedirs(self._dbhome)
+
+ def checkDBHomeExists(self):
+ assert os.path.isdir(self._dbhome)
-class FullBaseFramework(unittest.TestCase):
- def setUp(self):
- import Full
- from ZODB import DB
-
- self._dbhome = 'test-db'
- os.mkdir(self._dbhome)
-
- try:
- self._storage = Full.Full(self._dbhome)
- self._db = DB(self._storage)
- self._conn = self._db.open()
- self._root = self._conn.root()
- except:
- self.tearDown()
- raise
-
- def tearDown(self):
- for file in os.listdir(self._dbhome):
- os.unlink(os.path.join(self._dbhome, file))
- os.removedirs(self._dbhome)
+class MinimalBaseFramework(BaseFramework):
+ import Minimal
+ ConcreteStorage = Minimal.Minimal
-
class MinimalDBHomeTest(MinimalBaseFramework):
- def checkDBHomeExists(self):
- """Minimal: Database creation w/ explicit db_home"""
- assert os.path.isdir(self._dbhome)
+ pass
+class FullBaseFramework(BaseFramework):
+ import Full
+ ConcreteStorage = Full.Full
+
class FullDBHomeTest(FullBaseFramework):
- def checkDBHomeExists(self):
- """Full: Database creation w/ explicit db_home"""
- assert os.path.isdir(self._dbhome)
+ pass