Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/xml/tasks/test-get-element-content-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-unicode.xml
9 dest: /tmp/ansible-xml-beers-unicode.xml
10
11
12 - name: Get element attributes
13 xml:
14 path: /tmp/ansible-xml-beers-unicode.xml
15 xpath: /business/rating
16 content: attribute
17 register: get_element_attribute
18
19 - name: Test expected result
20 assert:
21 that:
22 - get_element_attribute is not changed
23 - get_element_attribute.matches[0]['rating'] is defined and get_element_attribute.matches[0]['rating']['subjective'] == 'да'
24
25 - name: Get element text
26 xml:
27 path: /tmp/ansible-xml-beers-unicode.xml
28 xpath: /business/rating
29 content: text
30 register: get_element_text
31
32 - name: Test expected result
33 assert:
34 that:
35 - get_element_text is not changed
36 - get_element_text.matches[0]['rating'] == 'десять'