Commit 865f697b authored by Jeremy Hylton's avatar Jeremy Hylton

Define removefs() for compatibility with Zope 2.5 &c.

parent c41bc70d
......@@ -22,7 +22,21 @@ import unittest
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):
......
......@@ -29,9 +29,24 @@ import ZEO.ClientStorage, ZEO.StorageServer
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment