summaryrefslogtreecommitdiffstats
path: root/test/units/utils
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2023-09-19 17:03:58 +0200
committerGitHub <noreply@github.com>2023-09-19 17:03:58 +0200
commit0ea40e09d1b35bcb69ff4d9cecf3d0defa4b36e8 (patch)
tree7c17700180d89f8766094d74a4bb731093857ad2 /test/units/utils
parentbump devel to 2.17.0.dev0 (#81712) (diff)
downloadansible-0ea40e09d1b35bcb69ff4d9cecf3d0defa4b36e8.tar.xz
ansible-0ea40e09d1b35bcb69ff4d9cecf3d0defa4b36e8.zip
vars: handle exception in combine_vars (#81700)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Diffstat (limited to 'test/units/utils')
-rw-r--r--test/units/utils/test_vars.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/units/utils/test_vars.py b/test/units/utils/test_vars.py
index 9be33de429..727e04c86f 100644
--- a/test/units/utils/test_vars.py
+++ b/test/units/utils/test_vars.py
@@ -27,6 +27,7 @@ from unittest import mock
from units.compat import unittest
from ansible.errors import AnsibleError
from ansible.utils.vars import combine_vars, merge_hash
+from ansible.vars.manager import VarsWithSources
class TestVariableUtils(unittest.TestCase):
@@ -43,6 +44,11 @@ class TestVariableUtils(unittest.TestCase):
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(
a=dict(a=1, c=dict(foo='bar')),
b=dict(b=2, c=dict(baz='bam')),
result=dict(a=1, b=2, c=dict(foo='bar', baz='bam'))
@@ -60,6 +66,11 @@ class TestVariableUtils(unittest.TestCase):
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(
a=dict(a=1, c=dict(foo='bar')),
b=dict(b=2, c=dict(baz='bam')),
result=dict(a=1, b=2, c=dict(baz='bam'))