Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/xml/tasks/test-remove-namespaced-attribute-nochange.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Setup test fixture
7 copy:
8 src: results/test-remove-namespaced-attribute.xml
9 dest: /tmp/ansible-xml-namespaced-beers.xml
10
11
12 - name: Remove non-existing namespaced '/bus:business/rat:rating/@attr:subjective'
13 xml:
14 path: /tmp/ansible-xml-namespaced-beers.xml
15 xpath: /bus:business/rat:rating/@attr:subjective
16 namespaces:
17 bus: http://test.business
18 ber: http://test.beers
19 rat: http://test.rating
20 attr: http://test.attribute
21 state: absent
22 register: remove_namespaced_attribute
23
24 - name: Compare to expected result
25 copy:
26 src: results/test-remove-namespaced-attribute.xml
27 dest: /tmp/ansible-xml-namespaced-beers.xml
28 check_mode: true
29 diff: true
30 register: comparison
31
32 - name: Test expected result
33 assert:
34 that:
35 - remove_namespaced_attribute is not changed
36 - comparison is not changed # identical
37 # command: diff -u {{ role_path }}/results/test-remove-namespaced-attribute.xml /tmp/ansible-xml-namespaced-beers.xml