Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/xml/tasks/test-pretty-print-only.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.orig
10
11 - name: Remove spaces from test fixture
12 shell: sed 's/^[ ]*//g' < /tmp/ansible-xml-beers.xml.orig > /tmp/ansible-xml-beers.xml
13
14 - name: Pretty print without modification
15 xml:
16 path: /tmp/ansible-xml-beers.xml
17 pretty_print: true
18 register: pretty_print_only
19
20 - name: Compare to expected result
21 copy:
22 src: results/test-pretty-print-only.xml
23 dest: /tmp/ansible-xml-beers.xml
24 check_mode: true
25 diff: true
26 register: comparison
27
28 - name: Test expected result
29 assert:
30 that:
31 - pretty_print_only is changed
32 - comparison is not changed # identical
33 # command: diff -u {{ role_path }}/results/test-pretty-print-only.xml /tmp/ansible-xml-beers.xml