mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Cleanup combine_vars
* Dedupe combine_vars() code (removed from VariableManager) * Fix merge_hash algorithm to preserve the type * unittest combine_vars and merge_hash
This commit is contained in:
parent
7fe495d619
commit
aeff960d02
5 changed files with 158 additions and 92 deletions
|
@ -48,20 +48,6 @@ class TestVariableManager(unittest.TestCase):
|
|||
|
||||
self.assertEqual(vars, dict(playbook_dir='.'))
|
||||
|
||||
self.assertEqual(
|
||||
v._merge_dicts(
|
||||
dict(a=1),
|
||||
dict(b=2)
|
||||
), dict(a=1, b=2)
|
||||
)
|
||||
self.assertEqual(
|
||||
v._merge_dicts(
|
||||
dict(a=1, c=dict(foo='bar')),
|
||||
dict(b=2, c=dict(baz='bam'))
|
||||
), dict(a=1, b=2, c=dict(foo='bar', baz='bam'))
|
||||
)
|
||||
|
||||
|
||||
def test_variable_manager_extra_vars(self):
|
||||
fake_loader = DictDataLoader({})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue