[Zodb-checkins] CVS: ZODB3/ZEO/tests - testConnection.py:1.10

Barry Warsaw barry@wooz.org
Mon, 13 Jan 2003 19:10:00 -0500


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

Modified Files:
	testConnection.py 
Log Message:
Add MappingStorage tests for Connection and Timeout tests
(ReconnectionTests make no sense for MappingStorage).

Also add BDBTimeoutTests.

Set the level for the FileStorageConnectionTests,
FileStorageTimeoutTests, BDBConnectionTests, BDBReconnectionTests, and
BDBTimeoutTests to level 2 so they aren't normally run.

MappingStorageConnectionTests and MappingStorageTimeoutTests both get
level 1 so they are normally always run.  FileStorageReconnectionTests
also gets level 1 since there s no MappingStorageReconnectionTests.


=== ZODB3/ZEO/tests/testConnection.py 1.9 => 1.10 ===
--- ZODB3/ZEO/tests/testConnection.py:1.9	Tue Jan  7 17:12:58 2003
+++ ZODB3/ZEO/tests/testConnection.py	Mon Jan 13 19:09:56 2003
@@ -35,7 +35,6 @@
                          create and 'yes' or 'no',
                          read_only and 'yes' or 'no')
 
-
 class BerkeleyStorageConfig:
     def getConfig(self, path, create, read_only):
         return """\
@@ -45,48 +44,91 @@
             read_only %s
         </Storage>""" % (path, read_only)
 
+class MappingStorageConfig:
+    def getConfig(self, path, create, read_only):
+        return """\
+        <Storage>
+            type MappingStorage
+            name %s
+        </Storage>""" % path
+
 
+
 class FileStorageConnectionTests(
     FileStorageConfig,
     ConnectionTests.ConnectionTests
     ):
     """FileStorage-specific connection tests."""
-
+    level = 2
 
 class FileStorageReconnectionTests(
     FileStorageConfig,
     ConnectionTests.ReconnectionTests
     ):
     """FileStorage-specific re-connection tests."""
+    # Run this at level 1 because MappingStorage can't do reconnection tests
+    level = 1
 
 class FileStorageTimeoutTests(
     FileStorageConfig,
     ConnectionTests.TimeoutTests
     ):
-    # doesn't test anything that is storage-specific
-    pass
+    level = 2
+
 
 class BDBConnectionTests(
     BerkeleyStorageConfig,
     ConnectionTests.ConnectionTests
     ):
     """Berkeley storage connection tests."""
-
+    level = 2
 
 class BDBReconnectionTests(
     BerkeleyStorageConfig,
     ConnectionTests.ReconnectionTests
     ):
     """Berkeley storage re-connection tests."""
+    level = 2
 
+class BDBTimeoutTests(
+    BerkeleyStorageConfig,
+    ConnectionTests.TimeoutTests
+    ):
+    level = 2
 
-test_classes = [FileStorageConnectionTests, FileStorageReconnectionTests,
+
+class MappingStorageConnectionTests(
+    MappingStorageConfig,
+    ConnectionTests.ConnectionTests
+    ):
+    """Mapping storage connection tests."""
+    level = 1
+
+# The ReconnectionTests can't work with MappingStorage because it's only an
+# in-memory storage and has no persistent state.
+
+class MappingStorageTimeoutTests(
+    MappingStorageConfig,
+    ConnectionTests.TimeoutTests
+    ):
+    level = 1
+
+
+
+test_classes = [FileStorageConnectionTests,
+                FileStorageReconnectionTests,
                 FileStorageTimeoutTests]
 
+test_classes.extend(
+    [MappingStorageConnectionTests,
+     MappingStorageTimeoutTests])
+
+
 import BDBStorage
 if BDBStorage.is_available:
     test_classes.append(BDBConnectionTests)
     test_classes.append(BDBReconnectionTests)
+    test_classes.append(BDBTimeoutTests)
 
 
 def test_suite():