mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-05 21:54:22 -07:00
[PR #7170/63030966 backport][stable-7] xfconf*: using yaml-specified unit tests (#7177)
xfconf*: using yaml-specified unit tests (#7170)
(cherry picked from commit 6303096648
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
1b09e8168a
commit
80113063ac
5 changed files with 301 additions and 432 deletions
83
tests/unit/plugins/modules/test_xfconf_info.yaml
Normal file
83
tests/unit/plugins/modules/test_xfconf_info.yaml
Normal file
|
@ -0,0 +1,83 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) Alexei Znamensky (russoz@gmail.com)
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
---
|
||||
- id: test_simple_property_get
|
||||
input:
|
||||
channel: xfwm4
|
||||
property: /general/inactive_opacity
|
||||
output:
|
||||
value: '100'
|
||||
is_array: false
|
||||
run_command_calls:
|
||||
- command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/inactive_opacity]
|
||||
environ: {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
|
||||
rc: 0
|
||||
out: "100\n"
|
||||
err: ""
|
||||
- id: test_simple_property_get_nonexistent
|
||||
input:
|
||||
channel: xfwm4
|
||||
property: /general/i_dont_exist
|
||||
output: {}
|
||||
run_command_calls:
|
||||
- command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/i_dont_exist]
|
||||
environ: {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
|
||||
rc: 1
|
||||
out: ""
|
||||
err: 'Property "/general/i_dont_exist" does not exist on channel "xfwm4".\n'
|
||||
- id: test_property_no_channel
|
||||
input:
|
||||
property: /general/i_dont_exist
|
||||
output:
|
||||
failed: true
|
||||
msg: "missing parameter(s) required by 'property': channel"
|
||||
run_command_calls: []
|
||||
- id: test_property_get_array
|
||||
input:
|
||||
channel: xfwm4
|
||||
property: /general/workspace_names
|
||||
output:
|
||||
is_array: true
|
||||
value_array: [Main, Work, Tmp]
|
||||
run_command_calls:
|
||||
- command: [/testbin/xfconf-query, --channel, xfwm4, --property, /general/workspace_names]
|
||||
environ: {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
|
||||
rc: 0
|
||||
out: "Value is an array with 3 items:\n\nMain\nWork\nTmp\n"
|
||||
err: ""
|
||||
- id: get_channels
|
||||
input: {}
|
||||
output:
|
||||
channels: [a, b, c]
|
||||
run_command_calls:
|
||||
- command: [/testbin/xfconf-query, --list]
|
||||
environ: {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
|
||||
rc: 0
|
||||
out: "Channels:\n a\n b\n c\n"
|
||||
err: ""
|
||||
- id: get_properties
|
||||
input:
|
||||
channel: xfwm4
|
||||
output:
|
||||
properties:
|
||||
- /general/wrap_cycle
|
||||
- /general/wrap_layout
|
||||
- /general/wrap_resistance
|
||||
- /general/wrap_windows
|
||||
- /general/wrap_workspaces
|
||||
- /general/zoom_desktop
|
||||
run_command_calls:
|
||||
- command: [/testbin/xfconf-query, --list, --channel, xfwm4]
|
||||
environ: {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
|
||||
rc: 0
|
||||
out: |
|
||||
/general/wrap_cycle
|
||||
/general/wrap_layout
|
||||
/general/wrap_resistance
|
||||
/general/wrap_windows
|
||||
/general/wrap_workspaces
|
||||
/general/zoom_desktop
|
||||
err: ""
|
Loading…
Add table
Add a link
Reference in a new issue