Fix unit and integration tests (#84554)

This is a follow-up to https://github.com/ansible/ansible/pull/84473
pull/84556/head
Matt Clay 11 months ago committed by GitHub
parent 7677bf1c9b
commit 5623a386c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -220,7 +220,7 @@
- assert: - assert:
that: that:
- with_dict_passed_a_list is failed - with_dict_passed_a_list is failed
- '"with_dict expects a dict" in with_dict_passed_a_list.msg' - '"lookup plugin expects a dictionary" in with_dict_passed_a_list.msg'
- debug: - debug:
msg: "with_list passed a dict: {{item}}" msg: "with_list passed a dict: {{item}}"
with_list: "{{ a_dict }}" with_list: "{{ a_dict }}"

@ -304,14 +304,14 @@ class TestTemplarLookup(BaseTemplar, unittest.TestCase):
def test_lookup_jinja_dict_string_passed(self): def test_lookup_jinja_dict_string_passed(self):
self.assertRaisesRegex(AnsibleError, self.assertRaisesRegex(AnsibleError,
"with_dict expects a dict", "lookup plugin expects a dictionary",
self.templar._lookup, self.templar._lookup,
'dict', 'dict',
'{{ some_var }}') '{{ some_var }}')
def test_lookup_jinja_dict_list_passed(self): def test_lookup_jinja_dict_list_passed(self):
self.assertRaisesRegex(AnsibleError, self.assertRaisesRegex(AnsibleError,
"with_dict expects a dict", "lookup plugin expects a dictionary",
self.templar._lookup, self.templar._lookup,
'dict', 'dict',
['foo', 'bar']) ['foo', 'bar'])

Loading…
Cancel
Save