Merge branch 'darkk-assert-with-msg' into devel
This commit is contained in:
commit
33cfdc4cbf
1 changed files with 12 additions and 5 deletions
|
@ -38,8 +38,7 @@ class ActionModule(object):
|
|||
args.update(complex_args)
|
||||
args.update(utils.parse_kv(module_args))
|
||||
|
||||
msg = ''
|
||||
|
||||
msg = None
|
||||
if 'msg' in args:
|
||||
msg = args['msg']
|
||||
|
||||
|
@ -50,8 +49,16 @@ class ActionModule(object):
|
|||
args['that'] = [ args['that'] ]
|
||||
|
||||
for that in args['that']:
|
||||
result = utils.check_conditional(that, self.runner.basedir, inject, fail_on_undefined=True)
|
||||
if not result:
|
||||
return ReturnData(conn=conn, result=dict(failed=True, assertion=that, evaluated_to=result))
|
||||
test_result = utils.check_conditional(that, self.runner.basedir, inject, fail_on_undefined=True)
|
||||
if not test_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'))
|
||||
|
||||
|
|
Loading…
Reference in a new issue