mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-07 18:58:05 +02:00
integration-test: Test mapping pending-charge to fully-charged
This commit is contained in:
parent
a953401420
commit
c4e561f54d
1 changed files with 25 additions and 0 deletions
|
|
@ -597,6 +597,31 @@ class Tests(dbusmock.DBusTestCase):
|
|||
self.assertEqual(self.get_dbus_display_property('State'), UP_DEVICE_STATE_CHARGING)
|
||||
self.stop_daemon()
|
||||
|
||||
def test_map_pending_charge_to_fully_charged(self):
|
||||
'''Map pending-charge to fully-charged'''
|
||||
|
||||
bat0 = self.testbed.add_device('power_supply', 'BAT0', None,
|
||||
['type', 'Battery',
|
||||
'present', '1',
|
||||
'status', 'Not charging',
|
||||
'charge_full', '10500000',
|
||||
'charge_full_design', '11000000',
|
||||
'capacity', '100',
|
||||
'voltage_now', '12000000'], [])
|
||||
|
||||
self.start_daemon()
|
||||
devs = self.proxy.EnumerateDevices()
|
||||
self.assertEqual(len(devs), 1)
|
||||
bat0_up = devs[0]
|
||||
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'State'), UP_DEVICE_STATE_FULLY_CHARGED)
|
||||
self.stop_daemon()
|
||||
|
||||
# and make sure we still return pending-charge below 100%
|
||||
self.testbed.set_attribute(bat0, 'capacity', '99')
|
||||
self.start_daemon()
|
||||
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'State'), UP_DEVICE_STATE_PENDING_CHARGE)
|
||||
self.stop_daemon()
|
||||
|
||||
def test_battery_charge(self):
|
||||
'''battery which reports charge instead of energy
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue