|
|
@ -27,6 +27,7 @@ from unittest import mock
|
|
|
|
from units.compat import unittest
|
|
|
|
from units.compat import unittest
|
|
|
|
from ansible.errors import AnsibleError
|
|
|
|
from ansible.errors import AnsibleError
|
|
|
|
from ansible.utils.vars import combine_vars, merge_hash
|
|
|
|
from ansible.utils.vars import combine_vars, merge_hash
|
|
|
|
|
|
|
|
from ansible.vars.manager import VarsWithSources
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestVariableUtils(unittest.TestCase):
|
|
|
|
class TestVariableUtils(unittest.TestCase):
|
|
|
@ -42,6 +43,11 @@ class TestVariableUtils(unittest.TestCase):
|
|
|
|
b=dict(b=2),
|
|
|
|
b=dict(b=2),
|
|
|
|
result=dict(a=1, b=2),
|
|
|
|
result=dict(a=1, b=2),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
dict(
|
|
|
|
|
|
|
|
a=dict(a=1),
|
|
|
|
|
|
|
|
b=VarsWithSources().new_vars_with_sources(dict(b=2), dict(b='task vars')),
|
|
|
|
|
|
|
|
result=dict(a=1, b=2),
|
|
|
|
|
|
|
|
),
|
|
|
|
dict(
|
|
|
|
dict(
|
|
|
|
a=dict(a=1, c=dict(foo='bar')),
|
|
|
|
a=dict(a=1, c=dict(foo='bar')),
|
|
|
|
b=dict(b=2, c=dict(baz='bam')),
|
|
|
|
b=dict(b=2, c=dict(baz='bam')),
|
|
|
@ -59,6 +65,11 @@ class TestVariableUtils(unittest.TestCase):
|
|
|
|
b=dict(b=2),
|
|
|
|
b=dict(b=2),
|
|
|
|
result=dict(a=1, b=2)
|
|
|
|
result=dict(a=1, b=2)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
dict(
|
|
|
|
|
|
|
|
a=dict(a=1),
|
|
|
|
|
|
|
|
b=VarsWithSources().new_vars_with_sources(dict(b=2), dict(b='task vars')),
|
|
|
|
|
|
|
|
result=dict(a=1, b=2),
|
|
|
|
|
|
|
|
),
|
|
|
|
dict(
|
|
|
|
dict(
|
|
|
|
a=dict(a=1, c=dict(foo='bar')),
|
|
|
|
a=dict(a=1, c=dict(foo='bar')),
|
|
|
|
b=dict(b=2, c=dict(baz='bam')),
|
|
|
|
b=dict(b=2, c=dict(baz='bam')),
|
|
|
|