Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/xml/tasks/test-set-namespaced-attribute-value.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: fixtures/ansible-xml-namespaced-beers.xml
9 dest: /tmp/ansible-xml-namespaced-beers.xml
10
11
12 - name: Set namespaced '/bus:business/rat:rating/@attr:subjective' to 'false'
13 xml:
14 path: /tmp/ansible-xml-namespaced-beers.xml
15 xpath: /bus:business/rat:rating
16 namespaces:
17 bus: http://test.business
18 ber: http://test.beers
19 rat: http://test.rating
20 attr: http://test.attribute
21 attribute: attr:subjective
22 value: 'false'
23 register: set_namespaced_attribute_value
24
25 - name: Add trailing newline
26 shell: echo "" >> /tmp/ansible-xml-namespaced-beers.xml
27
28 - name: Compare to expected result
29 copy:
30 src: results/test-set-namespaced-attribute-value.xml
31 dest: /tmp/ansible-xml-namespaced-beers.xml
32 check_mode: true
33 diff: true
34 register: comparison
35
36 - name: Test expected result
37 assert:
38 that:
39 - set_namespaced_attribute_value is changed
40 - comparison is not changed # identical
41 # command: diff -u {{ role_path }}/results/test-set-namespaced-attribute-value.xml /tmp/ansible-xml-namespaced-beers.xml