Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/xml/tasks/test-add-children-with-attributes-unicode.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-beers.xml
9 dest: /tmp/ansible-xml-beers.xml
10
11
12 - name: Add child element
13 xml:
14 path: /tmp/ansible-xml-beers.xml
15 xpath: /business/beers
16 add_children:
17 - beer:
18 name: Окское
19 type: экстра
20 register: add_children_with_attributes_unicode
21
22 - name: Add trailing newline
23 shell: echo "" >> /tmp/ansible-xml-beers.xml
24
25 - name: Compare to expected result
26 copy:
27 src: results/test-add-children-with-attributes-unicode.xml
28 dest: /tmp/ansible-xml-beers.xml
29 check_mode: true
30 diff: true
31 register: comparison
32
33 - name: Test expected result
34 assert:
35 that:
36 - add_children_with_attributes_unicode is changed
37 - comparison is not changed # identical
38 # command: diff -u {{ role_path }}/results/test-add-children-with-attributes-unicode.xml /tmp/ansible-xml-beers.xml