mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-08 14:20:04 -07:00
VarDict module utils: add as_dict()
method (#6602)
* VarDict module utils: add `as_dict()` method * add changelog frag
This commit is contained in:
parent
c9aae5e45c
commit
59db302deb
3 changed files with 14 additions and 0 deletions
|
@ -122,3 +122,12 @@ def test_vardict_change():
|
|||
assert vd.has_changed is False
|
||||
vd.xx = 12345
|
||||
assert vd.has_changed is True
|
||||
|
||||
|
||||
def test_vardict_dict():
|
||||
vd = VarDict()
|
||||
vd.set("xx", 123)
|
||||
vd.set("yy", 456)
|
||||
vd.set("zz", 789)
|
||||
|
||||
assert vd.as_dict() == {"xx": 123, "yy": 456, "zz": 789}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue