[Zope-Checkins] CVS: ZODB3/ZEO/tests - speed.py:1.9.10.1 testConnection.py:1.1.2.3 testZEO.py:1.54.2.4

Barry Warsaw barry@zope.com
Fri, 25 Jul 2003 15:39:18 -0400


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

Modified Files:
      Tag: ZODB3-3_1-branch
	speed.py testConnection.py testZEO.py 
Log Message:
You need to now give the full pkg.module.class path to the storage
class you want to run in the zeo server.  Also, add a BDBTests class
and supporting code so that BDBFullStorage runs under zeo.


=== ZODB3/ZEO/tests/speed.py 1.9 => 1.9.10.1 ===
--- ZODB3/ZEO/tests/speed.py:1.9	Thu Sep  5 15:28:07 2002
+++ ZODB3/ZEO/tests/speed.py	Fri Jul 25 15:39:12 2003
@@ -159,7 +159,7 @@
         s = s.Storage
         server = None
     else:
-        s, server, pid = forker.start_zeo("FileStorage",
+        s, server, pid = forker.start_zeo("ZODB.FileStorage.FileStorage",
                                           (fs_name, 1), domain=domain)
 
     data=open(data).read()


=== ZODB3/ZEO/tests/testConnection.py 1.1.2.2 => 1.1.2.3 ===
--- ZODB3/ZEO/tests/testConnection.py:1.1.2.2	Mon Jan 20 16:54:28 2003
+++ ZODB3/ZEO/tests/testConnection.py	Fri Jul 25 15:39:12 2003
@@ -45,7 +45,8 @@
         path = "%s.%d" % (self.file, index)
         addr = self.addr[index]
         pid, server = forker.start_zeo_server(
-            'FileStorage', (path, create, read_only), addr, ro_svr,
+            'ZODB.FileStorage.FileStorage',
+            (path, create, read_only), addr, ro_svr,
             transaction_timeout=transaction_timeout)
         self._pids.append(pid)
         self._servers.append(server)
@@ -74,7 +75,8 @@
         addr = self.addr[index]
         args = (path, '='+str(create), '='+str(read_only))
         _addr, test_addr, test_pid = forker.start_zeo_server(
-            'FileStorage', args, addr, ro_svr, transaction_timeout)
+            'ZODB.FileStorage.FileStorage',
+            args, addr, ro_svr, transaction_timeout)
         self._pids.append(test_pid)
         self._servers.append(test_addr)
 


=== ZODB3/ZEO/tests/testZEO.py 1.54.2.3 => 1.54.2.4 ===
--- ZODB3/ZEO/tests/testZEO.py:1.54.2.3	Fri Oct  4 12:01:57 2002
+++ ZODB3/ZEO/tests/testZEO.py	Fri Jul 25 15:39:12 2003
@@ -17,6 +17,7 @@
 import os
 import sys
 import time
+import shutil
 import socket
 import asyncore
 import tempfile
@@ -163,11 +164,33 @@
 
     def getStorage(self):
         self.__fs_base = tempfile.mktemp()
-        return 'FileStorage', (self.__fs_base, '1')
+        return 'ZODB.FileStorage.FileStorage', (self.__fs_base, '1')
 
     def delStorage(self):
         removefs(self.__fs_base)
 
+
+def BDBFactory(path, storage):
+    from BDBStorage.BDBFullStorage import BDBFullStorage
+    from BDBStorage.BDBMinimalStorage import BDBMinimalStorage
+
+    if storage == 'full':
+        return BDBFullStorage(path)
+    elif storage == 'minimal':
+        return BDBMinimalStorage(path)
+    else:
+        assert 0, storage
+
+
+class BDBTests(UnixTests):
+    def getStorage(self):
+        self.__bdbdir = tempfile.mktemp()
+        return 'ZEO.tests.testZEO.BDBFactory', (self.__bdbdir, 'full')
+
+    def delStorage(self):
+        shutil.rmtree(self.__bdbdir)
+
+
 class WindowsTests(GenericTests):
 
     """Add Windows-specific scaffolding to the generic test suite."""
@@ -194,7 +217,7 @@
 
     def getStorageInfo(self):
         self.__fs_base = tempfile.mktemp()
-        return 'FileStorage', (self.__fs_base, '1') # create=1
+        return 'ZODB.FileStorage.FileStorage', (self.__fs_base, '1') # create=1
 
     def delStorage(self):
         removefs(self.__fs_base)
@@ -206,8 +229,11 @@
 else:
     raise RuntimeError, "unsupported os: %s" % os.name
 
-def test_suite():
+import BDBStorage
+if BDBStorage.is_available:
+    test_classes.append(BDBTests)
 
+def test_suite():
     # shutup warnings about mktemp
     import warnings
     warnings.filterwarnings("ignore", "mktemp")
@@ -216,6 +242,7 @@
     for klass in test_classes:
         sub = unittest.makeSuite(klass, 'check')
         suite.addTest(sub)
+
     return suite
 
 if __name__ == "__main__":