[Zodb-checkins] CVS: ZODB3/ZEO/tests - testZEO.py:1.54.2.2

Jeremy Hylton jeremy@zope.com
Fri, 4 Oct 2002 11:53:06 -0400


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

Modified Files:
      Tag: ZODB3-3_1-branch
	testZEO.py 
Log Message:
Attempt to worm around checkWriteMethods with Zope 2.5.1.


=== ZODB3/ZEO/tests/testZEO.py 1.54.2.1 => 1.54.2.2 ===
--- ZODB3/ZEO/tests/testZEO.py:1.54.2.1	Thu Oct  3 20:09:05 2002
+++ ZODB3/ZEO/tests/testZEO.py	Fri Oct  4 11:53:04 2002
@@ -26,6 +26,7 @@
 import zLOG
 
 # ZODB test support
+import ZODB
 from ZODB.tests.MinPO import MinPO
 from ZODB.tests.StorageTestBase import zodb_unpickle
 
@@ -129,6 +130,16 @@
         addr = self._storage._addr
         self._storage.close()
         self._storage = ClientStorage(addr, read_only=read_only, wait=1)
+
+    def checkWriteMethods(self):
+        # ReadOnlyStorage defines checkWriteMethods.  The decision
+        # about where to raise the read-only error was changed after
+        # Zope 2.5 was released.  So this test needs to detect Zope
+        # of the 2.5 vintage and skip the test.
+
+        # The __version__ attribute was not present in Zope 2.5.
+        if hasattr(ZODB, "__version__"):
+           ReadOnlyStorage.ReadOnlyStorage.checkWriteMethods(self) 
 
 class UnixTests(GenericTests):