diff --git a/product/ERP5Type/tests/ProcessingNodeTestCase.py b/product/ERP5Type/tests/ProcessingNodeTestCase.py index 3bd0f54100b96387e6497d0defc0229bbefcfbdd..3c3dc569298fea9b07b18cbdcf8cbc824b84fb5a 100644 --- a/product/ERP5Type/tests/ProcessingNodeTestCase.py +++ b/product/ERP5Type/tests/ProcessingNodeTestCase.py @@ -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 diff --git a/product/ERP5Type/tests/runUnitTest.py b/product/ERP5Type/tests/runUnitTest.py index 0716adc14198f1329b15578707b476dcb2399c99..1fba79aa743e961266ca9006bee5dc70c51223e8 100755 --- a/product/ERP5Type/tests/runUnitTest.py +++ b/product/ERP5Type/tests/runUnitTest.py @@ -565,15 +565,15 @@ def runUnitTestList(test_list, verbosity=1, debug=0): _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.')