test/battery: add multiple-battery edge case
This commit is contained in:
8
test/plugins/battery.plugin.bats
Normal file → Executable file
8
test/plugins/battery.plugin.bats
Normal file → Executable file
@@ -196,7 +196,15 @@ function setup_upower {
|
||||
percent="$1"
|
||||
|
||||
function upower {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user