[REF] config/test: renamed test-* config params to use underscores as all others, for consistency.

This will only break existing config files, but command-line stays the same with hyphens of course.

bzr revid: odo@openerp.com-20100810131755-rjwipw4pqhg3uev3
This commit is contained in:
Olivier Dony
2010-08-10 15:17:55 +02:00
parent 891eb265b6
commit 910cc41a51
3 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -634,14 +634,14 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs):
def load_test(cr, module_name, id_map, mode):
cr.commit()
if not tools.config.options['test-disable']:
if not tools.config.options['test_disable']:
try:
_load_data(cr, module_name, id_map, mode, 'test')
except Exception, e:
logger.notifyChannel('ERROR', netsvc.LOG_TEST, e)
pass
finally:
if tools.config.options['test-commit']:
if tools.config.options['test_commit']:
cr.commit()
else:
cr.rollback()
+3 -3
View File
@@ -116,11 +116,11 @@ if not ( tools.config["stop_after_init"] or \
if tools.config['db_name']:
for dbname in tools.config['db_name'].split(','):
db,pool = pooler.get_db_and_pool(dbname, update_module=tools.config['init'] or tools.config['update'], pooljobs=False)
if tools.config["test-file"]:
if tools.config["test_file"]:
logger.notifyChannel("init", netsvc.LOG_INFO,
'loading test file %s' % (tools.config["test-file"],))
'loading test file %s' % (tools.config["test_file"],))
cr = db.cursor()
tools.convert_yaml_import(cr, 'base', file(tools.config["test-file"]), {}, 'test', True)
tools.convert_yaml_import(cr, 'base', file(tools.config["test_file"]), {}, 'test', True)
cr.rollback()
pool.get('ir.cron')._poolJobs(db.dbname)
+7 -7
View File
@@ -82,9 +82,9 @@ class configmanager(object):
'login_message': False,
'list_db' : True,
'timezone' : False, # to override the default TZ
'test-file' : False,
'test-disable' : False,
'test-commit' : False,
'test_file' : False,
'test_disable' : False,
'test_commit' : False,
'static_http_enable': False,
'static_http_document_root': None,
'static_http_url_prefix': None,
@@ -155,10 +155,10 @@ class configmanager(object):
# Testing Group
group = optparse.OptionGroup(parser, "Testing Configuration")
group.add_option("--test-file", dest="test-file", help="Launch a YML test file.")
group.add_option("--test-disable", action="store_true", dest="test-disable",
group.add_option("--test-file", dest="test_file", help="Launch a YML test file.")
group.add_option("--test-disable", action="store_true", dest="test_disable",
default=False, help="Disable loading test files.")
group.add_option("--test-commit", action="store_true", dest="test-commit",
group.add_option("--test-commit", action="store_true", dest="test_commit",
default=False, help="Commit database changes performed by tests.")
parser.add_option_group(group)
@@ -283,7 +283,7 @@ class configmanager(object):
keys = ['language', 'translate_out', 'translate_in', 'debug_mode',
'stop_after_init', 'logrotate', 'without_demo', 'netrpc', 'xmlrpc', 'syslog',
'list_db', 'server_actions_allow_code', 'xmlrpcs',
'test-file', 'test-disable', 'test-commit'
'test_file', 'test_disable', 'test_commit'
]
for arg in keys: