[coverage] improve test coverage for indexed_items lookup (#74548)

This commit is contained in:
David Shrewsbury 2021-05-04 11:41:02 -04:00 committed by GitHub
parent 244bf9c640
commit 4f0a9488bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,3 +14,19 @@
- "x2 == 'set'"
- "x3 == 'set'"
- "x4 == 'set'"
- block:
- name: "EXPECTED FAILURE - test not a list"
debug:
msg: "{{ item.0 }} is {{ item.1 }}"
with_indexed_items:
"a": 1
- fail:
msg: "should not get here"
rescue:
- assert:
that:
- ansible_failed_task.name == "EXPECTED FAILURE - test not a list"
- ansible_failed_result.msg == "with_indexed_items expects a list"