Merge branch 'darkk-assert-with-msg' into devel

pull/8062/merge
James Cammarata 11 years ago
commit 33cfdc4cbf

@ -38,8 +38,7 @@ class ActionModule(object):
args.update(complex_args) args.update(complex_args)
args.update(utils.parse_kv(module_args)) args.update(utils.parse_kv(module_args))
msg = '' msg = None
if 'msg' in args: if 'msg' in args:
msg = args['msg'] msg = args['msg']
@ -50,8 +49,16 @@ class ActionModule(object):
args['that'] = [ args['that'] ] args['that'] = [ args['that'] ]
for that in args['that']: for that in args['that']:
result = utils.check_conditional(that, self.runner.basedir, inject, fail_on_undefined=True) test_result = utils.check_conditional(that, self.runner.basedir, inject, fail_on_undefined=True)
if not result: if not test_result:
return ReturnData(conn=conn, result=dict(failed=True, assertion=that, evaluated_to=result)) result = dict(
failed = True,
evaluated_to = test_result,
assertion = that,
)
if msg:
result['msg'] = msg
return ReturnData(conn=conn, result=result)
return ReturnData(conn=conn, result=dict(msg='all assertions passed')) return ReturnData(conn=conn, result=dict(msg='all assertions passed'))

Loading…
Cancel
Save