[Erp5-report] r36713 jm - /erp5/trunk/products/ERP5Type/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jun 30 10:21:59 CEST 2010


Author: jm
Date: Wed Jun 30 10:21:58 2010
New Revision: 36713

URL: http://svn.erp5.org?rev=36713&view=rev
Log:
ERP5Type.tests: fix --live_instance and activity_tool

Modified:
    erp5/trunk/products/ERP5Type/tests/ProcessingNodeTestCase.py
    erp5/trunk/products/ERP5Type/tests/runUnitTest.py

Modified: erp5/trunk/products/ERP5Type/tests/ProcessingNodeTestCase.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/ProcessingNodeTestCase.py?rev=36713&r1=36712&r2=36713&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/ProcessingNodeTestCase.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/ProcessingNodeTestCase.py [utf8] Wed Jun 30 10:21:58 2010
@@ -16,8 +16,10 @@ def patchActivityTool():
   from Products.CMFActivity.ActivityTool import ActivityTool
   def patch(function):
     name = function.__name__
-    setattr(ActivityTool, '_orig_' + name, getattr(ActivityTool, name))
+    orig_function = getattr(ActivityTool, name)
+    setattr(ActivityTool, '_orig_' + name, orig_function)
     setattr(ActivityTool, name, function)
+    function.__doc__ = orig_function.__doc__
 
   # When a ZServer can't be started, the node name ends with ':' (no port).
   @patch

Modified: erp5/trunk/products/ERP5Type/tests/runUnitTest.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/runUnitTest.py?rev=36713&r1=36712&r2=36713&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/runUnitTest.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/runUnitTest.py [utf8] Wed Jun 30 10:21:58 2010
@@ -565,15 +565,15 @@ def runUnitTestList(test_list, verbosity
         _print('Dumping static files...\n')
       live_instance_path = os.environ.get('live_instance_path')
       for static_dir in static_dir_list:
-        try:
-          shutil.rmtree(static_dir + '.bak')
-        except OSError, e:
-          if e.errno != errno.ENOENT:
-            raise
         if live_instance_path:
           backup_path = os.path.join(live_instance_path, static_dir)
         else:
           backup_path = static_dir + '.bak'
+        try:
+          shutil.rmtree(backup_path)
+        except OSError, e:
+          if e.errno != errno.ENOENT:
+            raise
         shutil.copytree(static_dir, backup_path, symlinks=True)
     elif zeo_client_pid_list is not None:
       _print('WARNING: No static files saved. You will have to do it manually.')




More information about the Erp5-report mailing list