Debian Codegraph @

test/integration/targets/ansible-inventory/tasks/toml.yml

raw symbols SCIP
1 - name: Install tomli-w package
2 pip:
3 name: tomli-w
4
5 - name: test toml parsing
6 command: ansible-inventory --list --toml -i {{ role_path }}/files/valid_sample.toml
7 register: toml_in
8
9 - assert:
10 that:
11 - >
12 'foo = "bar"' in toml_in.stdout
13 - '"[somegroup.hosts.something.some_dict]" in toml_in.stdout'
14 - '"some_int = 1" in toml_in.stdout'
15 - '"some_float = 1.1" in toml_in.stdout'
16 - '"some_bool = true" in toml_in.stdout'
17 - '"some_list = [" in toml_in.stdout'
18
19 # DTFIX3: plug in variable visitor on TOML output and re-enable this test
20 #- name: "test option: --toml with valid group name"
21 # command: ansible-inventory --list --toml -i {{ role_path }}/files/valid_sample.yml
22 # register: result
23 #
24 #- assert:
25 # that:
26 # - result is succeeded
27
28 - block:
29 - name: "test toml output with unicode characters"
30 command: ansible-inventory --list --toml -i {{ role_path }}/files/unicode.yml
31 register: result
32
33 - assert:
34 that:
35 - result is succeeded
36 - result.stdout is contains('příbor')
37
38 - block:
39 - name: "test toml output file with unicode characters"
40 command: ansible-inventory --list --toml --output unicode_inventory.toml -i {{ role_path }}/files/unicode.yml
41
42 - set_fact:
43 toml_inventory_file: "{{ lookup('file', 'unicode_inventory.toml') | string }}"
44
45 - assert:
46 that:
47 - toml_inventory_file is contains('příbor')
48 always:
49 - file:
50 name: unicode_inventory.toml
51 state: absent