Fix with_dict/with_list being passed incorrect type tests (#71699)

These tests were failing due to a variable passed being undefined
instead of being of an incorrect type which is the actual
intent of the tests.
This commit is contained in:
Martin Krizek 2020-09-11 07:53:10 +02:00 committed by GitHub
parent 7a0e545700
commit 59a240cd31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,17 +213,26 @@
with_dict: "{{ a_list }}"
register: with_dict_passed_a_list
ignore_errors: True
vars:
a_list:
- 1
- 2
- assert:
that:
- with_dict_passed_a_list is failed
- '"with_dict expects a dict" in with_dict_passed_a_list.msg'
- debug:
msg: "with_list passed a dict: {{item}}"
with_list: "{{ a_dict }}"
register: with_list_passed_a_dict
ignore_errors: True
vars:
a_dict:
key: value
- assert:
that:
- with_list_passed_a_dict is failed
- '"with_list expects a list" in with_list_passed_a_dict.msg'
- debug:
var: "item"