[Zope-Checkins] CVS: ZODB3/ZEO/tests - testConnection.py:1.1.2.4
Barry Warsaw
barry@zope.com
Mon, 28 Jul 2003 13:46:46 -0400
Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv17754/ZEO/tests
Modified Files:
Tag: ZODB3-3_1-branch
testConnection.py
Log Message:
Extend these tests so we can also run them on Berkeley storage
(although only BDBFullStorage for now).
=== ZODB3/ZEO/tests/testConnection.py 1.1.2.3 => 1.1.2.4 ===
--- ZODB3/ZEO/tests/testConnection.py:1.1.2.3 Fri Jul 25 15:39:12 2003
+++ ZODB3/ZEO/tests/testConnection.py Mon Jul 28 13:46:40 2003
@@ -21,6 +21,7 @@
import os
import time
import socket
+import tempfile
import unittest
# Zope/ZODB3 imports
@@ -45,7 +46,7 @@
path = "%s.%d" % (self.file, index)
addr = self.addr[index]
pid, server = forker.start_zeo_server(
- 'ZODB.FileStorage.FileStorage',
+ self.getStorage(),
(path, create, read_only), addr, ro_svr,
transaction_timeout=transaction_timeout)
self._pids.append(pid)
@@ -61,6 +62,17 @@
except os.error, err:
print err
+class FileStorageConnectionTests(UnixConnectionTests):
+ def getStorage(self):
+ return 'ZODB.FileStorage.FileStorage'
+
+
+class BDBConnectionTests(UnixConnectionTests):
+ def getStorage(self):
+ self.__bdbdir = tempfile.mktemp()
+ return 'ZEO.tests.testZEO.BDBFactory'
+
+
class WindowsConnectionTests(ConnectionTests):
"""Add Windows-specific scaffolding to the generic test suite."""
@@ -91,11 +103,16 @@
time.sleep(0.5)
if os.name == "posix":
- test_classes = [UnixConnectionTests]
+ test_classes = [FileStorageConnectionTests]
elif os.name == "nt":
test_classes = [WindowsConnectionTests]
else:
raise RuntimeError, "unsupported os: %s" % os.name
+
+import BDBStorage
+if BDBStorage.is_available:
+ test_classes.append(BDBConnectionTests)
+
def test_suite():