[CMF-checkins] SVN: CMF/trunk/CMFCore/tests/ - made sure we have a writable copy and can delete it (http://www.zope.org/Collectors/CMF/106)

Yvo Schubbe y.2005- at wcm-solutions.de
Tue Jul 19 07:09:04 EDT 2005


Log message for revision 37329:
  - made sure we have a writable copy and can delete it (http://www.zope.org/Collectors/CMF/106)
  - added missing tearDown call

Changed:
  U   CMF/trunk/CMFCore/tests/base/testcase.py
  U   CMF/trunk/CMFCore/tests/test_FSZSQLMethod.py

-=-
Modified: CMF/trunk/CMFCore/tests/base/testcase.py
===================================================================
--- CMF/trunk/CMFCore/tests/base/testcase.py	2005-07-19 11:07:04 UTC (rev 37328)
+++ CMF/trunk/CMFCore/tests/base/testcase.py	2005-07-19 11:08:33 UTC (rev 37329)
@@ -2,12 +2,13 @@
 import Zope2
 Zope2.startup()
 
-from os import curdir, mkdir, stat, remove
+import sys
+import time
+from os import chmod, curdir, mkdir, remove, stat, walk
 from os.path import join, abspath, dirname
 from shutil import copytree, rmtree
+from stat import S_IWRITE
 from tempfile import mktemp
-import sys
-import time
 
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.SecurityManagement import noSecurityManager
@@ -214,6 +215,10 @@
                       self._skinname),
                  join(self.tempname,
                       self._skinname))
+        # make sure we have a writable copy
+        for root, dirs, files in walk(self.tempname):
+            for name in dirs + files:
+                chmod(join(root, name), S_IWRITE)
         # store the skin path name
         self.skin_path_name = join(self.tempname,self._skinname,self._layername)
 

Modified: CMF/trunk/CMFCore/tests/test_FSZSQLMethod.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_FSZSQLMethod.py	2005-07-19 11:07:04 UTC (rev 37328)
+++ CMF/trunk/CMFCore/tests/test_FSZSQLMethod.py	2005-07-19 11:08:33 UTC (rev 37329)
@@ -60,6 +60,10 @@
 
         self.fsZSQL = self.fsdir.testsql
 
+    def tearDown(self):
+        SecurityTest.tearDown(self)
+        FSZSQLMaker.tearDown(self)
+
     def test_customize( self ):
 
         self.fsZSQL.manage_doCustomize( folder_path='custom' )



More information about the CMF-checkins mailing list