[Zodb-checkins] SVN: ZODB/trunk/src/Z Addressed various windows test issues.
Jim Fulton
jim at zope.com
Mon Sep 22 18:37:10 EDT 2008
Log message for revision 91385:
Addressed various windows test issues.
Changed:
U ZODB/trunk/src/ZEO/tests/test_cache.py
U ZODB/trunk/src/ZODB/tests/blob_packing.txt
U ZODB/trunk/src/ZODB/tests/blob_transaction.txt
U ZODB/trunk/src/ZODB/tests/testblob.py
-=-
Modified: ZODB/trunk/src/ZEO/tests/test_cache.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/test_cache.py 2008-09-22 21:17:59 UTC (rev 91384)
+++ ZODB/trunk/src/ZEO/tests/test_cache.py 2008-09-22 22:37:08 UTC (rev 91385)
@@ -343,6 +343,8 @@
>>> logger.setLevel(logging.NOTSET)
>>> logger.removeHandler(handler)
+
+ >>> cache.close()
"""
)
Modified: ZODB/trunk/src/ZODB/tests/blob_packing.txt
===================================================================
--- ZODB/trunk/src/ZODB/tests/blob_packing.txt 2008-09-22 21:17:59 UTC (rev 91384)
+++ ZODB/trunk/src/ZODB/tests/blob_packing.txt 2008-09-22 22:37:08 UTC (rev 91385)
@@ -146,7 +146,7 @@
Clean up our blob directory and database:
- >>> shutil.rmtree(blob_dir)
+ >>> rmtree(blob_dir)
>>> base_storage.close()
>>> os.unlink(storagefile)
>>> os.unlink(storagefile+".index")
@@ -273,4 +273,4 @@
Clean up our blob directory:
- >>> shutil.rmtree(blob_dir)
+ >>> rmtree(blob_dir)
Modified: ZODB/trunk/src/ZODB/tests/blob_transaction.txt
===================================================================
--- ZODB/trunk/src/ZODB/tests/blob_transaction.txt 2008-09-22 21:17:59 UTC (rev 91384)
+++ ZODB/trunk/src/ZODB/tests/blob_transaction.txt 2008-09-22 22:37:08 UTC (rev 91385)
@@ -364,6 +364,5 @@
>>> tm1.abort()
>>> tm2.abort()
>>> database.close()
- >>> import shutil
- >>> shutil.rmtree(blob_dir)
- >>> shutil.rmtree(blob_dir2)
+ >>> rmtree(blob_dir)
+ >>> rmtree(blob_dir2)
Modified: ZODB/trunk/src/ZODB/tests/testblob.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testblob.py 2008-09-22 21:17:59 UTC (rev 91384)
+++ ZODB/trunk/src/ZODB/tests/testblob.py 2008-09-22 22:37:08 UTC (rev 91385)
@@ -12,9 +12,9 @@
#
##############################################################################
-import base64, os, shutil, tempfile, unittest
+import base64, os, re, shutil, stat, sys, tempfile, unittest
import time
-from zope.testing import doctest
+from zope.testing import doctest, renormalizing
import ZODB.tests.util
from StringIO import StringIO
@@ -474,6 +474,11 @@
"""
+# On windows, we can't create secure blob directories, at least not
+# with APIs in the standard library, so there's no point in testing
+# this.
+if sys.platform == 'win32':
+ del secure_blob_directory
def loadblob_tmpstore():
"""
@@ -521,14 +526,28 @@
>>> database.close()
>>> import shutil
- >>> shutil.rmtree(blob_dir)
+ >>> rmtree(blob_dir)
>>> os.unlink(storagefile)
>>> os.unlink(storagefile+".index")
>>> os.unlink(storagefile+".tmp")
"""
+def setUp(test):
+ ZODB.tests.util.setUp(test)
+ def rmtree(path):
+ for path, dirs, files in os.walk(path, False):
+ for fname in files:
+ fname = os.path.join(path, fname)
+ os.chmod(fname, stat.S_IWUSR)
+ os.remove(fname)
+ for dname in dirs:
+ dname = os.path.join(path, dname)
+ os.rmdir(dname)
+ os.rmdir(path)
+ test.globs['rmtree'] = rmtree
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(ZODBBlobConfigTest))
@@ -536,12 +555,16 @@
"blob_basic.txt", "blob_connection.txt", "blob_transaction.txt",
"blob_packing.txt", "blob_importexport.txt", "blob_consume.txt",
"blob_tempdir.txt",
- setUp=ZODB.tests.util.setUp,
+ setUp=setUp,
tearDown=ZODB.tests.util.tearDown,
))
suite.addTest(doctest.DocTestSuite(
- setUp=ZODB.tests.util.setUp,
+ setUp=setUp,
tearDown=ZODB.tests.util.tearDown,
+ checker = renormalizing.RENormalizing([
+ (re.compile(r'\%(sep)s\%(sep)s' % dict(sep=os.path.sep)), '/'),
+ (re.compile(r'\%(sep)s' % dict(sep=os.path.sep)), '/'),
+ ]),
))
suite.addTest(unittest.makeSuite(BlobUndoTests))
More information about the Zodb-checkins
mailing list