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

Jeremy Hylton jeremy@zope.com
Wed, 14 Aug 2002 12:55:15 -0400


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

Modified Files:
	testZEO.py 
Log Message:
Define removefs() for compatibility with Zope 2.5 &c.


=== ZODB3/ZEO/tests/testZEO.py 1.26 => 1.27 ===
--- ZODB3/ZEO/tests/testZEO.py:1.26	Thu Aug  8 14:25:10 2002
+++ ZODB3/ZEO/tests/testZEO.py	Wed Aug 14 12:55:15 2002
@@ -29,8 +29,23 @@
 import ThreadedAsync, ZEO.trigger
 from ZODB.FileStorage import FileStorage
 from ZODB.Transaction import Transaction
-from ZODB.tests.StorageTestBase import zodb_pickle, MinPO, removefs
+from ZODB.tests.StorageTestBase import zodb_pickle, MinPO
 import zLOG
+
+try:
+    from ZODB.tests.StorageTestBase import removefs
+except ImportError:
+    # for compatibility with Zope 2.5 &c.
+    def removefs(base):
+        """Remove all files created by FileStorage with path base."""
+        for ext in '', '.old', '.tmp', '.lock', '.index', '.pack':
+            path = base + ext
+            try:
+                os.remove(path)
+            except os.error, err:
+                if err[0] != errno.ENOENT:
+                    raise
+
 
 from ZEO.tests import forker, Cache, CommitLockTests, ThreadTests
 from ZEO.smac import Disconnected