[Zodb-checkins] CVS: ZODB3/ZEO/tests - testConnection.py:1.11 testZEO.py:1.68 zeoserver.py:1.14

Jeremy Hylton jeremy at zope.com
Fri May 23 18:34:00 EDT 2003


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv13485/ZEO/tests

Modified Files:
	testConnection.py testZEO.py zeoserver.py 
Log Message:
Remove old configuration approach in favor of current ZConfig schema.

Update the ZEO tests to use the new configuration language.
Remove files from old configuration approach.


=== ZODB3/ZEO/tests/testConnection.py 1.10 => 1.11 ===
--- ZODB3/ZEO/tests/testConnection.py:1.10	Mon Jan 13 19:09:56 2003
+++ ZODB3/ZEO/tests/testConnection.py	Fri May 23 17:33:29 2003
@@ -26,32 +26,25 @@
 class FileStorageConfig:
     def getConfig(self, path, create, read_only):
         return """\
-        <Storage>
-            type FileStorage
-            file_name %s
-            create %s
-            read_only %s
-        </Storage>""" % (path,
-                         create and 'yes' or 'no',
-                         read_only and 'yes' or 'no')
+        <filestorage>
+        path %s
+        create %s
+        read-only %s
+        </filestorage>""" % (path,
+                             create and 'yes' or 'no',
+                             read_only and 'yes' or 'no')
 
 class BerkeleyStorageConfig:
     def getConfig(self, path, create, read_only):
         return """\
-        <Storage>
-            type BDBFullStorage
-            name %s
-            read_only %s
-        </Storage>""" % (path, read_only)
+        <fullstorage>
+        name %s
+        read-only %s
+        </fullstorage>""" % (path, read_only)
 
 class MappingStorageConfig:
     def getConfig(self, path, create, read_only):
-        return """\
-        <Storage>
-            type MappingStorage
-            name %s
-        </Storage>""" % path
-
+        return """<mappingstorage/>"""
 
 
 class FileStorageConnectionTests(


=== ZODB3/ZEO/tests/testZEO.py 1.67 => 1.68 ===
--- ZODB3/ZEO/tests/testZEO.py:1.67	Thu May  8 13:48:41 2003
+++ ZODB3/ZEO/tests/testZEO.py	Fri May 23 17:33:29 2003
@@ -150,20 +150,11 @@
     def getConfig(self):
         filename = self.__fs_base = tempfile.mktemp()
         return """\
-        <Storage>
-            type FileStorage
-            file_name %s
-            create yes
-        </Storage>
+        <filestorage>
+        path %s
+        </filestorage>
         """ % filename
 
-    def checkPackVersionsInPast(self):
-        # FileStorage can't cope with backpointers to objects
-        # created in versions.  Should fix if we can figure out actually how
-        # to fix it.
-        pass
-
-
 class BDBTests(FileStorageTests):
     """ZEO backed by a Berkeley full storage."""
     level = 2
@@ -171,23 +162,16 @@
     def getConfig(self):
         self._envdir = tempfile.mktemp()
         return """\
-        <Storage>
-            type BDBFullStorage
-            name %s
-        </Storage>
+        <fullstorage>
+        name %s
+        </fullstorage>
         """ % self._envdir
 
 class MappingStorageTests(FileStorageTests):
     """ZEO backed by a Mapping storage."""
 
     def getConfig(self):
-        self._envdir = tempfile.mktemp()
-        return """\
-        <Storage>
-            type MappingStorage
-            name %s
-        </Storage>
-        """ % self._envdir
+        return """<mappingstorage/>"""
 
     # Tests which MappingStorage can't possibly pass, because it doesn't
     # support versions or undo.


=== ZODB3/ZEO/tests/zeoserver.py 1.13 => 1.14 ===
--- ZODB3/ZEO/tests/zeoserver.py:1.13	Fri Feb 28 18:41:25 2003
+++ ZODB3/ZEO/tests/zeoserver.py	Fri May 23 17:33:29 2003
@@ -26,15 +26,8 @@
 
 import ZConfig.Context
 import zLOG
-from ZODB import StorageConfig
 import ZEO.StorageServer
-
-
-def load_storage(fp):
-    context = ZConfig.Context.Context()
-    rootconf = context.loadFile(fp)
-    storageconf = rootconf.getSection('Storage')
-    return StorageConfig.createStorage(storageconf)
+from ZODB.config import storageFromURL
 
 
 def cleanup(storage):
@@ -166,9 +159,7 @@
             monitor_address = '', int(arg)
     # Open the config file and let ZConfig parse the data there.  Then remove
     # the config file, otherwise we'll leave turds.
-    fp = open(configfile, 'r')
-    storage = load_storage(fp)
-    fp.close()
+    storage = storageFromURL(configfile)
     os.remove(configfile)
     # The rest of the args are hostname, portnum
     zeo_port = int(args[0])




More information about the Zodb-checkins mailing list