mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-29 23:18:55 +00:00
test helper: add support for check and diff modes (#9666)
This commit is contained in:
parent
439da9e6da
commit
c0f57b5c62
2 changed files with 47 additions and 7 deletions
|
|
@ -72,7 +72,13 @@ class Helper(object):
|
|||
"""
|
||||
Run unit tests for each test case in self.test_cases
|
||||
"""
|
||||
patch_ansible_module(test_case.input)
|
||||
args = {}
|
||||
args.update(test_case.input)
|
||||
if test_case.flags.get("check"):
|
||||
args["_ansible_check_mode"] = test_case.flags.get("check")
|
||||
if test_case.flags.get("diff"):
|
||||
args["_ansible_diff"] = test_case.flags.get("diff")
|
||||
patch_ansible_module(args)
|
||||
self.runner.run(mocker, capfd, test_case)
|
||||
|
||||
self.add_func_to_test_module("test_module", _test_module)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue