Debian Codegraph @

ansible_collections/community/general/tests/unit/plugins/modules/test_xfconf.yaml

raw
1 # Copyright (c) Alexei Znamensky ([email protected])
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 ---
6 anchors:
7 environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: false}
8 version_out: &version-output |
9 xfconf-query 4.18.1
10
11 Copyright (c) 2008-2023
12 The Xfce development team. All rights reserved.
13
14 Please report bugs to <https://gitlab.xfce.org/xfce/xfconf>.
15 test_cases:
16 - id: test_missing_input
17 input: {}
18 output:
19 failed: true
20 msg: 'missing required arguments: channel, property'
21 - id: test_property_set_property
22 input:
23 channel: xfwm4
24 property: /general/inactive_opacity
25 state: present
26 value_type: int
27 value: 90
28 output:
29 changed: true
30 previous_value: '100'
31 type: int
32 value: '90'
33 version: 4.18.1
34 mocks:
35 run_command:
36 - command: [/testbin/xfconf-query, --version]
37 environ: *env-def
38 rc: 0
39 out: *version-output
40 err: ''
41 - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity]
42 environ: *env-def
43 rc: 0
44 out: "100\n"
45 err: ''
46 - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity, --create, --type, int, --set, '90']
47 environ: *env-def
48 rc: 0
49 out: ''
50 err: ''
51 - id: test_property_set_property_same_value
52 input:
53 channel: xfwm4
54 property: /general/inactive_opacity
55 state: present
56 value_type: int
57 value: 90
58 output:
59 changed: false
60 previous_value: '90'
61 type: int
62 value: '90'
63 version: 4.18.1
64 mocks:
65 run_command:
66 - command: [/testbin/xfconf-query, --version]
67 environ: *env-def
68 rc: 0
69 out: *version-output
70 err: ''
71 - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity]
72 environ: *env-def
73 rc: 0
74 out: "90\n"
75 err: ''
76 - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity, --create, --type, int, --set, '90']
77 environ: *env-def
78 rc: 0
79 out: ''
80 err: ''
81 - id: test_property_set_property_bool_same_value
82 input:
83 channel: xfce4-session
84 property: /general/SaveOnExit
85 state: present
86 value_type: bool
87 value: false
88 output:
89 changed: false
90 previous_value: 'false'
91 type: bool
92 value: 'false'
93 version: 4.18.1
94 mocks:
95 run_command:
96 - command: [/testbin/xfconf-query, --version]
97 environ: *env-def
98 rc: 0
99 out: *version-output
100 err: ''
101 - command: [/testbin/xfconf-query, --channel, xfce4-session, --property, /general/SaveOnExit]
102 environ: *env-def
103 rc: 0
104 out: "false\n"
105 err: ''
106 - command: [/testbin/xfconf-query, --channel, xfce4-session, --property, /general/SaveOnExit, --create, --type, bool, --set, 'false']
107 environ: *env-def
108 rc: 0
109 out: ''
110 err: ''
111 - id: test_property_set_property_bool_false
112 input:
113 channel: xfce4-session
114 property: /general/SaveOnExit
115 state: present
116 value_type: bool
117 value: false
118 output:
119 changed: true
120 previous_value: 'true'
121 type: bool
122 value: 'false'
123 version: 4.18.1
124 mocks:
125 run_command:
126 - command: [/testbin/xfconf-query, --version]
127 environ: *env-def
128 rc: 0
129 out: *version-output
130 err: ''
131 - command: [/testbin/xfconf-query, --channel, xfce4-session, --property, /general/SaveOnExit]
132 environ: *env-def
133 rc: 0
134 out: "true\n"
135 err: ''
136 - command: [/testbin/xfconf-query, --channel, xfce4-session, --property, /general/SaveOnExit, --create, --type, bool, --set, 'false']
137 environ: *env-def
138 rc: 0
139 out: "false\n"
140 err: ''
141 - id: test_property_set_array
142 input:
143 channel: xfwm4
144 property: /general/workspace_names
145 state: present
146 value_type: string
147 value: [A, B, C]
148 output:
149 changed: true
150 previous_value: [Main, Work, Tmp]
151 type: [string, string, string]
152 value: [A, B, C]
153 version: 4.18.1
154 mocks:
155 run_command:
156 - command: [/testbin/xfconf-query, --version]
157 environ: *env-def
158 rc: 0
159 out: *version-output
160 err: ''
161 - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names]
162 environ: *env-def
163 rc: 0
164 out: "Value is an array with 3 items:\n\nMain\nWork\nTmp\n"
165 err: ''
166 - command:
167 - /testbin/xfconf-query
168 - --channel
169 - xfwm4
170 - --property
171 - /general/workspace_names
172 - --create
173 - --force-array
174 - --type
175 - string
176 - --set
177 - A
178 - --type
179 - string
180 - --set
181 - B
182 - --type
183 - string
184 - --set
185 - C
186 environ: *env-def
187 rc: 0
188 out: ''
189 err: ''
190 - id: test_property_set_array_to_same_value
191 input:
192 channel: xfwm4
193 property: /general/workspace_names
194 state: present
195 value_type: string
196 value: [A, B, C]
197 output:
198 changed: false
199 previous_value: [A, B, C]
200 type: [string, string, string]
201 value: [A, B, C]
202 version: 4.18.1
203 mocks:
204 run_command:
205 - command: [/testbin/xfconf-query, --version]
206 environ: *env-def
207 rc: 0
208 out: *version-output
209 err: ''
210 - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names]
211 environ: *env-def
212 rc: 0
213 out: "Value is an array with 3 items:\n\nA\nB\nC\n"
214 err: ''
215 - command:
216 - /testbin/xfconf-query
217 - --channel
218 - xfwm4
219 - --property
220 - /general/workspace_names
221 - --create
222 - --force-array
223 - --type
224 - string
225 - --set
226 - A
227 - --type
228 - string
229 - --set
230 - B
231 - --type
232 - string
233 - --set
234 - C
235 environ: *env-def
236 rc: 0
237 out: ''
238 err: ''
239 - id: test_property_array_previously_empty
240 input:
241 channel: xfwm4
242 property: /general/workspace_names
243 state: present
244 value_type: string
245 value: [A, B, C]
246 output:
247 changed: true
248 previous_value: []
249 type: [string, string, string]
250 value: [A, B, C]
251 version: 4.18.1
252 mocks:
253 run_command:
254 - command: [/testbin/xfconf-query, --version]
255 environ: *env-def
256 rc: 0
257 out: *version-output
258 err: ''
259 - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names]
260 environ: *env-def
261 rc: 0
262 out: "Value is an array with 0 items:\n\n"
263 err: ''
264 - command:
265 - /testbin/xfconf-query
266 - --channel
267 - xfwm4
268 - --property
269 - /general/workspace_names
270 - --create
271 - --force-array
272 - --type
273 - string
274 - --set
275 - A
276 - --type
277 - string
278 - --set
279 - B
280 - --type
281 - string
282 - --set
283 - C
284 environ: *env-def
285 rc: 0
286 out: ''
287 err: ''
288 - id: test_property_reset_value
289 input:
290 channel: xfwm4
291 property: /general/workspace_names
292 state: absent
293 output:
294 changed: true
295 previous_value: [A, B, C]
296 type:
297 value:
298 version: 4.18.1
299 mocks:
300 run_command:
301 - command: [/testbin/xfconf-query, --version]
302 environ: *env-def
303 rc: 0
304 out: *version-output
305 err: ''
306 - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names]
307 environ: *env-def
308 rc: 0
309 out: "Value is an array with 3 items:\n\nA\nB\nC\n"
310 err: ''
311 - command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names, --reset]
312 environ: *env-def
313 rc: 0
314 out: ''
315 err: ''