mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
minor fixes to template function
- make sure it calls itself correctly, now passes same params as it recieves - vars is reserved, changed for templatevars to avoid confustion - forcing mustaches again since the removal broke 'listification' as per #9622 - fixes incorrectly successful tests using undefined var, now it is defined - now returns empty list if items is None to avoid errors
This commit is contained in:
@@ -568,10 +568,8 @@ class TestUtils(unittest.TestCase):
|
||||
basedir = os.path.dirname(__file__)
|
||||
|
||||
# Straight lookups
|
||||
self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict()),
|
||||
['things'])
|
||||
self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=['one', 'two'])),
|
||||
['one', 'two'])
|
||||
self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=[])), [])
|
||||
self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=['one', 'two'])), ['one', 'two'])
|
||||
|
||||
# Variable interpolation
|
||||
self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=['{{ foo }}', '{{ bar }}'], foo="hello", bar="world")),
|
||||
|
||||
Reference in New Issue
Block a user