test/battery: add multiple-battery edge case
parent
cade0a1e7a
commit
23f7916a4d
|
|
@ -193,11 +193,19 @@ function setup_acpi {
|
||||||
# Creates a `upower` function that simulates output like the real `upower` command.
|
# Creates a `upower` function that simulates output like the real `upower` command.
|
||||||
# The passed in parameter is used for the remaining battery percentage.
|
# The passed in parameter is used for the remaining battery percentage.
|
||||||
function setup_upower {
|
function setup_upower {
|
||||||
percent="$1"
|
percent="$1"
|
||||||
|
|
||||||
function upower {
|
function upower {
|
||||||
printf "voltage: 12.191 V\n time to full: 57.3 minutes\n percentage: %s\n capacity: 84.6964" "${percent}"
|
case $1 in
|
||||||
}
|
'-e'|'--enumerate')
|
||||||
|
echo "/org/freedesktop/UPower/devices/battery_BAT0"
|
||||||
|
echo "/org/freedesktop/UPower/devices/mouse_hid_${RANDOM}_battery"
|
||||||
|
;;
|
||||||
|
'-i'|'--show-info')
|
||||||
|
printf "voltage: 12.191 V\n time to full: 57.3 minutes\n percentage: %s\n capacity: 84.6964" "${percent}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@test 'plugins battery: battery-percentage with upower, 100%' {
|
@test 'plugins battery: battery-percentage with upower, 100%' {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue