mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2025-12-20 04:20:04 +01:00
linux: integration-test: determining a low power charger based on battery percenatge change
If the line power is attached and the battery percentage drops 3% within 300 seconds, upower determines the attached line power is a low-power charger.
This commit is contained in:
parent
c0750c5dd9
commit
30449acecc
1 changed files with 4 additions and 1 deletions
|
|
@ -676,9 +676,12 @@ class Tests(dbusmock.DBusTestCase):
|
|||
|
||||
# a low power charger causes the battery is discharging and the AC is online
|
||||
self.testbed.set_attribute(ac, "online", "1")
|
||||
self.testbed.set_attribute(bat0, "energy_now", "3600000")
|
||||
self.testbed.set_attribute(bat0, "status", "Discharging")
|
||||
self.testbed.set_attribute(bat0, "energy_now", "1500000")
|
||||
self.start_daemon()
|
||||
time.sleep(5)
|
||||
self.testbed.set_attribute(bat0, "energy_now", "1500000")
|
||||
time.sleep(30)
|
||||
devs = self.proxy.EnumerateDevices()
|
||||
self.assertEqual(len(devs), 2)
|
||||
self.assertEqual(self.get_dbus_property("OnBattery"), True)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue