[Zodb-checkins] CVS: StandaloneZODB/Tools/tests - testzeopack.py:1.7

Jeremy Hylton jeremy@zope.com
Thu, 8 Aug 2002 14:25:41 -0400


Update of /cvs-repository/StandaloneZODB/Tools/tests
In directory cvs.zope.org:/tmp/cvs-serv17911/Tools/tests

Modified Files:
	testzeopack.py 
Log Message:
Refactor test cleanup to use removefs() helper function.

StorageTestBase.removefs() will attempt to remove files with all the
possible extensions that FileStorage will create.  It will raise
os.error for any error except ENOENT.

Remove many variants of removefs() implemented in the various test
suites.


=== StandaloneZODB/Tools/tests/testzeopack.py 1.6 => 1.7 ===
--- StandaloneZODB/Tools/tests/testzeopack.py:1.6	Wed Jan 30 17:10:48 2002
+++ StandaloneZODB/Tools/tests/testzeopack.py	Thu Aug  8 14:25:10 2002
@@ -3,7 +3,7 @@
 # For this to work, zeopack.py must by on your PATH.
 
 from ZODB.FileStorage import FileStorage
-from ZODB.tests.StorageTestBase import StorageTestBase
+from ZODB.tests.StorageTestBase import StorageTestBase, removefs
 from ZEO.tests import forker
 import ZODB
 
@@ -52,12 +52,7 @@
         except os.error, err:
             ##print "waitpid failed", err
             pass
-        for ext in '', '.old', '.lock', '.index', '.tmp':
-            path = self.path + ext
-            try:
-                os.remove(path)
-            except os.error:
-                pass
+        removefs(self.path)
 
     def set_inet_addr(self):
         self.host = socket.gethostname()