mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-28 11:59:09 -07:00
deps module utils: unit tests + minor improvement (#9179)
* deps module utils: unit tests + minor improvement * deps.clear() calls dict.clear() instead of creating new dict * add changelog frag
This commit is contained in:
parent
152339a8f9
commit
a3bd49c010
5 changed files with 81 additions and 1 deletions
|
@ -14,6 +14,7 @@ from ansible_collections.community.general.plugins.module_utils.module_helper im
|
|||
)
|
||||
|
||||
|
||||
# remove in 11.0.0
|
||||
def test_dependency_ctxmgr():
|
||||
ctx = DependencyCtxMgr("POTATOES", "Potatoes must be installed")
|
||||
with ctx:
|
||||
|
@ -36,6 +37,7 @@ def test_dependency_ctxmgr():
|
|||
assert ctx.has_it
|
||||
|
||||
|
||||
# remove in 11.0.0
|
||||
def test_variable_meta():
|
||||
meta = VarMeta()
|
||||
assert meta.output is True
|
||||
|
@ -51,6 +53,7 @@ def test_variable_meta():
|
|||
assert meta.diff_result is None
|
||||
|
||||
|
||||
# remove in 11.0.0
|
||||
def test_variable_meta_diff():
|
||||
meta = VarMeta(diff=True)
|
||||
assert meta.output is True
|
||||
|
@ -70,6 +73,7 @@ def test_variable_meta_diff():
|
|||
assert meta.diff_result == {"before": "abc", "after": "ghi"}
|
||||
|
||||
|
||||
# remove in 11.0.0
|
||||
def test_vardict():
|
||||
vd = VarDict()
|
||||
vd.set('a', 123)
|
||||
|
@ -99,6 +103,7 @@ def test_vardict():
|
|||
assert vd.diff() == {'before': {'a': 123}, 'after': {'a': 'new_a'}}, "diff={0}".format(vd.diff())
|
||||
|
||||
|
||||
# remove in 11.0.0
|
||||
def test_variable_meta_change():
|
||||
vd = VarDict()
|
||||
vd.set('a', 123, change=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue