mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
[PR #6602/59db302d backport][stable-7] VarDict module utils: add as_dict() method (#6610)
VarDict module utils: add `as_dict()` method (#6602)
* VarDict module utils: add `as_dict()` method
* add changelog frag
(cherry picked from commit 59db302deb)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user