[Zodb-checkins]
SVN: ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/
- fixed leakages of file handles
Christian Theune
ct at gocept.com
Mon Feb 27 19:14:38 EST 2006
Log message for revision 65552:
- fixed leakages of file handles
Changed:
U ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/basic.txt
U ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/importexport.txt
U ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/packing.txt
U ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/test_config.py
-=-
Modified: ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/basic.txt
===================================================================
--- ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/basic.txt 2006-02-28 00:08:04 UTC (rev 65551)
+++ ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/basic.txt 2006-02-28 00:14:38 UTC (rev 65552)
@@ -159,3 +159,8 @@
1
>>> shutil.rmtree(tempdir)
>>> del os.environ['ZODB_BLOB_TEMPDIR']
+
+Some cleanup in this test is needed:
+
+ >>> import transaction
+ >>> transaction.get().abort()
Modified: ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/importexport.txt
===================================================================
--- ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/importexport.txt 2006-02-28 00:08:04 UTC (rev 65551)
+++ ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/importexport.txt 2006-02-28 00:14:38 UTC (rev 65552)
@@ -85,11 +85,18 @@
True
>>> items1['blob2'].open().read() == items2['blob2'].open().read()
True
+ >>> transaction.get().abort()
Clean up our blob directory:
+ >>> base_storage1.close()
+ >>> base_storage2.close()
>>> shutil.rmtree(blob_dir1)
>>> shutil.rmtree(blob_dir2)
>>> os.unlink(exportfile)
>>> os.unlink(storagefile1)
+ >>> os.unlink(storagefile1+".index")
+ >>> os.unlink(storagefile1+".tmp")
>>> os.unlink(storagefile2)
+ >>> os.unlink(storagefile2+".index")
+ >>> os.unlink(storagefile2+".tmp")
Modified: ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/packing.txt
===================================================================
--- ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/packing.txt 2006-02-28 00:08:04 UTC (rev 65551)
+++ ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/packing.txt 2006-02-28 00:14:38 UTC (rev 65552)
@@ -30,7 +30,6 @@
>>> storagefile = mktemp()
>>> blob_dir = mkdtemp()
-
UNDOING
=======
@@ -149,7 +148,11 @@
Clean up our blob directory and database:
>>> shutil.rmtree(blob_dir)
+ >>> base_storage.close()
>>> os.unlink(storagefile)
+ >>> os.unlink(storagefile+".index")
+ >>> os.unlink(storagefile+".tmp")
+ >>> os.unlink(storagefile+".old")
NON-UNDOING
===========
Modified: ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/test_config.py
===================================================================
--- ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/test_config.py 2006-02-28 00:08:04 UTC (rev 65551)
+++ ZODB/branches/blob-merge-branch/src/ZODB/Blobs/tests/test_config.py 2006-02-28 00:14:38 UTC (rev 65552)
@@ -12,6 +12,7 @@
#
##############################################################################
import tempfile, shutil, unittest
+import os
from ZODB.tests.testConfig import ConfigTestBase
from ZConfig import ConfigurationSyntaxError
@@ -55,8 +56,11 @@
</blobstorage>
</zodb>
""" %(self.blob_dir, path))
+ os.unlink(path)
+ os.unlink(path+".index")
+ os.unlink(path+".tmp")
- def test_blod_dir_needed(self):
+ def test_blob_dir_needed(self):
self.assertRaises(ConfigurationSyntaxError,
self._test,
"""
More information about the Zodb-checkins
mailing list