From 9b3712cbdf36f35ba6f5b39d68e110401ce647fc Mon Sep 17 00:00:00 2001 From: Till Maas Date: Tue, 8 Jan 2019 16:22:22 +0100 Subject: [PATCH] test asserts: Clarify name --- tests/tasks/assert-device_absent.yml | 4 +++- tests/tasks/assert-device_present.yml | 5 +++-- tests/tasks/assert-profile_absent.yml | 2 +- tests/tasks/assert-profile_present.yml | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/tasks/assert-device_absent.yml b/tests/tasks/assert-device_absent.yml index f7ca03c..eee79d4 100644 --- a/tests/tasks/assert-device_absent.yml +++ b/tests/tasks/assert-device_absent.yml @@ -1,7 +1,9 @@ # SPDX-License-Identifier: BSD-3-Clause --- +# need to run setup again when this is just a task to ensure ansible_interfaces +# is current - setup: -- name: "assert that {{ interface }} is absent" +- name: "assert that interface {{ interface }} is absent" assert: that: "{{ not interface in ansible_interfaces }}" msg: "{{ interface }} is in ansible_interfaces: {{ ansible_interfaces }}" diff --git a/tests/tasks/assert-device_present.yml b/tests/tasks/assert-device_present.yml index e11a2a7..1f72fb6 100644 --- a/tests/tasks/assert-device_present.yml +++ b/tests/tasks/assert-device_present.yml @@ -1,8 +1,9 @@ # SPDX-License-Identifier: BSD-3-Clause --- -# need to run setup again when this is just a task to make sure ansible_interfaces is correct +# need to run setup again when this is just a task to ensure ansible_interfaces +# is current - setup: -- name: "assert that {{ interface }} is present" +- name: "assert that interface {{ interface }} is present" assert: that: "{{ interface in ansible_interfaces }}" msg: "{{ interface }} is not in ansible_interfaces: {{ ansible_interfaces }}" diff --git a/tests/tasks/assert-profile_absent.yml b/tests/tasks/assert-profile_absent.yml index 91aebaa..2695041 100644 --- a/tests/tasks/assert-profile_absent.yml +++ b/tests/tasks/assert-profile_absent.yml @@ -8,7 +8,7 @@ path: "{{ profile_path }}" register: profile_stat -- name: "assert that {{ profile }} is absent" +- name: "assert that profile '{{ profile }}' is absent" assert: that: not profile_stat.stat.exists msg: "profile {{ profile_path }} does exist" diff --git a/tests/tasks/assert-profile_present.yml b/tests/tasks/assert-profile_present.yml index 35bd04e..57a9f4b 100644 --- a/tests/tasks/assert-profile_present.yml +++ b/tests/tasks/assert-profile_present.yml @@ -8,7 +8,7 @@ path: "{{ profile_path }}" register: profile_stat -- name: "assert that {{ profile }} is present" +- name: "assert that profile '{{ profile }}' is present" assert: that: profile_stat.stat.exists msg: "profile {{ profile_path }} does not exist"