[Zope3-checkins] CVS: Zope3/src/zodb/storage/tests - base.py:1.12 test_file.py:1.9

Jeremy Hylton jeremy@zope.com
Fri, 14 Mar 2003 14:41:17 -0500


Update of /cvs-repository/Zope3/src/zodb/storage/tests
In directory cvs.zope.org:/tmp/cvs-serv17822/storage/tests

Modified Files:
	base.py test_file.py 
Log Message:
Use cleanup() method instead of removefs().


=== Zope3/src/zodb/storage/tests/base.py 1.11 => 1.12 ===
--- Zope3/src/zodb/storage/tests/base.py:1.11	Fri Mar 14 12:58:30 2003
+++ Zope3/src/zodb/storage/tests/base.py	Fri Mar 14 14:41:17 2003
@@ -94,16 +94,6 @@
     __import__(name)
     return sys.modules[name]
 
-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 C(Persistent):
     pass
 


=== Zope3/src/zodb/storage/tests/test_file.py 1.8 => 1.9 ===
--- Zope3/src/zodb/storage/tests/test_file.py:1.8	Fri Mar 14 14:23:25 2003
+++ Zope3/src/zodb/storage/tests/test_file.py	Fri Mar 14 14:41:17 2003
@@ -51,14 +51,13 @@
                                                       **kwargs)
 
     def setUp(self):
-        base.removefs("FileStorageTests.fs")
         self.open(create=1)
 
     def tearDown(self):
         get_transaction().abort()
         self._test_read_index()
         self._storage.close()
-        base.removefs("FileStorageTests.fs")
+        self._storage.cleanup()
 
     def _test_read_index(self):
         # For each test, open a read-only copy and make sure that
@@ -96,19 +95,16 @@
 class FileStorageRecoveryTest(base.StorageTestBase, recovery.RecoveryStorage):
 
     def setUp(self):
-        base.removefs("Source.fs")
-        base.removefs("Dest.fs")
         self._storage = zodb.storage.file.FileStorage('Source.fs')
         self._dst = zodb.storage.file.FileStorage('Dest.fs')
 
     def tearDown(self):
         self._storage.close()
         self._dst.close()
-        base.removefs("Source.fs")
-        base.removefs("Dest.fs")
+        self._storage.cleanup()
+        self._dst.cleanup()
 
     def new_dest(self):
-        base.removefs('Dest.fs')
         return zodb.storage.file.FileStorage('Dest.fs')
 
 def test_suite():
@@ -118,8 +114,3 @@
     suite.addTest(suite2)
     suite.addTest(suite3)
     return suite
-
-def main():
-    alltests=test_suite()
-    runner = unittest.TextTestRunner()
-    runner.run(alltests)