mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
9f08cc11a8
xfconf*: using yaml-specified unit tests (#7170)
(cherry picked from commit 6303096648
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
83 lines
2.5 KiB
YAML
83 lines
2.5 KiB
YAML
# -*- 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: ""
|