From c6fda9fc1ad67efcd32e33411c127d240e3977d1 Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Tue, 4 May 2021 11:41:22 -0400 Subject: [PATCH] [coverage] improve test coverage for together lookup (#74549) --- .../targets/lookup_together/tasks/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/integration/targets/lookup_together/tasks/main.yml b/test/integration/targets/lookup_together/tasks/main.yml index ee59a2aec66..71365a15300 100644 --- a/test/integration/targets/lookup_together/tasks/main.yml +++ b/test/integration/targets/lookup_together/tasks/main.yml @@ -12,3 +12,18 @@ - "b == '2'" - "c == '3'" - "d == '4'" + +- block: + - name: "EXPECTED FAILURE - test empty list" + debug: + msg: "{{ item.0 }} and {{ item.1 }}" + with_together: [] + + - fail: + msg: "should not get here" + + rescue: + - assert: + that: + - ansible_failed_task.name == "EXPECTED FAILURE - test empty list" + - ansible_failed_result.msg == "with_together requires at least one element in each list" \ No newline at end of file