[Zope3-checkins] CVS: ZODB4/ZODB/tests - MTStorage.py:1.6 speed.py:1.6 testConnection.py:1.3 testZODB.py:1.4

Jeremy Hylton jeremy@zope.com
Thu, 18 Jul 2002 16:26:19 -0400


Update of /cvs-repository/ZODB4/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv22609/ZODB/tests

Modified Files:
	MTStorage.py speed.py testConnection.py testZODB.py 
Log Message:
Remove all the magic from ZODB's __init__.py.

You need to get ZODB.DB.DB and get_transaction() explicitly now.












=== ZODB4/ZODB/tests/MTStorage.py 1.5 => 1.6 ===
 import threading
 import time
 
-import ZODB
+import ZODB.DB
 from Persistence import PersistentMapping
 from Transaction import Transaction, get_transaction
 
@@ -185,11 +185,11 @@
             t.join()
     
     def check2ZODBThreads(self):
-        db = ZODB.DB(self._storage)
+        db = ZODB.DB.DB(self._storage)
         self._checkNThreads(2, ZODBClientThread, db, self)
 
     def check7ZODBThreads(self):
-        db = ZODB.DB(self._storage)
+        db = ZODB.DB.DB(self._storage)
         self._checkNThreads(7, ZODBClientThread, db, self)
 
     def check2StorageThreads(self):


=== ZODB4/ZODB/tests/speed.py 1.5 => 1.6 ===
 import sys, os, getopt, string, time
 sys.path.insert(0, os.getcwd())
 
-import ZODB, ZODB.FileStorage
+import ZODB.DB, ZODB.FileStorage
 import Persistence
 from Transaction import get_transaction
 
@@ -76,7 +76,7 @@
         s=ZODB.FileStorage.FileStorage('zeo_speed.fs', create=1)
 
     data=open(data).read()
-    db=ZODB.DB(s,
+    db=ZODB.DB.DB(s,
                # disable cache deactivation
                cache_size=4000,
                cache_deactivate_after=6000,)


=== ZODB4/ZODB/tests/testConnection.py 1.2 => 1.3 ===
 from Persistence import Persistent
 from Transaction.tests.abstestIDataManager import IDataManagerTests
 
-import ZODB
-from ZODB.MappingStorage import MappingStorage
+from ZODB.MappingStorage import DB
 
 class P(Persistent):
     pass
@@ -25,15 +24,13 @@
 class ConnectionTests(IDataManagerTests):
 
     def setUp(self):
-        self.storage = MappingStorage()
-        self.db = ZODB.DB(self.storage)
+        self.db = DB()
         self.datamgr = self.db.open()
         self.obj = P()
 
     def tearDown(self):
         self.datamgr.close()
         self.db.close()
-        self.storage.close()
 
 def test_suite():
     return unittest.makeSuite(ConnectionTests)


=== ZODB4/ZODB/tests/testZODB.py 1.3 => 1.4 ===
 import sys, os
 import unittest
 
-import ZODB
-import ZODB.FileStorage
+import ZODB.DB, ZODB.FileStorage
 from Persistence import PersistentMapping
 from Transaction import get_transaction
 
@@ -101,7 +100,7 @@
             pass
         self._storage = ZODB.FileStorage.FileStorage(
             'ZODBTests.fs', create=1)
-        self._db = ZODB.DB(self._storage)
+        self._db = ZODB.DB.DB(self._storage)
         get_transaction().begin()
         conn = self._db.open()
         root = conn.root()