[Zodb-checkins] CVS: ZODB3/ZEO/tests - testStart.py:1.6
Jeremy Hylton
jeremy@zope.com
Wed, 14 Aug 2002 12:56:42 -0400
Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv1613
Modified Files:
testStart.py
Log Message:
Define removefs() for compatibility with Zope 2.5 &c.
=== ZODB3/ZEO/tests/testStart.py 1.5 => 1.6 ===
--- ZODB3/ZEO/tests/testStart.py:1.5 Thu Aug 8 14:25:10 2002
+++ ZODB3/ZEO/tests/testStart.py Wed Aug 14 12:56:41 2002
@@ -22,7 +22,21 @@
import ZEO.start
from ZEO.ClientStorage import ClientStorage
from ZEO.util import Environment
-from ZODB.tests.StorageTestBase import removefs
+
+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
+
class StartTests(unittest.TestCase):