mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-29 22:01:27 -07: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:
parent
d36c38c35e
commit
7d2937b1cc
4 changed files with 25 additions and 24 deletions
|
@ -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")),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue