[Zope-Checkins] CVS: Zope/lib/python/Products/ZODBMountPoint/tests - testMountPoint.py:1.4

Jeremy Hylton jeremy at zope.com
Thu Apr 15 12:41:06 EDT 2004


Update of /cvs-repository/Zope/lib/python/Products/ZODBMountPoint/tests
In directory cvs.zope.org:/tmp/cvs-serv13728/src/Products/ZODBMountPoint/tests

Modified Files:
	testMountPoint.py 
Log Message:
Change the implementation of mounted connections.

Avoid the monkey patch by creating a subclass of Connection and
installing it as the klass attribute of ZODB's DB class.  I think this
works correctly in conjunction with Zope configuration (the tests
pass) -- but I'm not qualified to say for sure.

Rework the logic of MountConnection as part of the restructuring.  The
_root_connection attribute always points to the root, never to None;
so the root object points to itself.  This change necessitated a
chance in DBTab.ClassFactories.  Add some comments there to explain
what's going on.

XXX The close() method on MountConnection is re-implementing two
methods in modules.  If those implementations change, it would need to
change, too.  We ought to find a better way to integrate it.

XXX Perhaps the mounted connection stuff should be folded into ZODB
proper.


=== Zope/lib/python/Products/ZODBMountPoint/tests/testMountPoint.py 1.3 => 1.4 ===
--- Zope/lib/python/Products/ZODBMountPoint/tests/testMountPoint.py:1.3	Sat Dec 20 11:58:57 2003
+++ Zope/lib/python/Products/ZODBMountPoint/tests/testMountPoint.py	Thu Apr 15 12:41:06 2004
@@ -22,7 +22,9 @@
 from OFS.Application import Application
 from OFS.Folder import Folder
 import App.config
-from Products.ZODBMountPoint.MountedObject import manage_addMounts, getMountPoint
+from Products.ZODBMountPoint.MountedObject \
+     import manage_addMounts, getMountPoint
+from Products.ZODBMountPoint.Mount import MountConnection
 from DBTab.DBTab import DBTab
 
 try:
@@ -36,7 +38,7 @@
         self.mpoints = mpoints
         
     def getDB(self):
-        from ZODB.config import DemoStorage
+        from ZODB.config import MappingStorage
         from ZODB.Connection import Connection
         from Zope.Startup.datatypes import ZopeDatabase
         self.name = self.fname
@@ -50,9 +52,9 @@
         self.version_pool_size = 3
         self.version_cache_size = 100
         self.mount_points = self.mpoints
-        self.connection_class = Connection
+        self.connection_class = MountConnection
         self.class_factory = None
-        self.storage = DemoStorage(self)
+        self.storage = MappingStorage(self)
         self.container_class = None
         return ZopeDatabase(self)
 




More information about the Zope-Checkins mailing list