Commit 34962ce7 authored by Julien Muchembled's avatar Julien Muchembled

ERP5Type.tests: fix --live_instance and activity_tool

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36713 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 96b79f2c
......@@ -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
......
......@@ -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.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment