summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-09-03 10:17:20 +0200
committerMartin Pitt <martinpitt@gnome.org>2013-09-03 10:17:20 +0200
commit5867d5432bebbb4f1aeaa11bcbd100b94bb74791 (patch)
tree71b3a797cd58422788297c26cfe8756ac801e5e0
parent440ee20f01ef4781d424a88ff06ba1f2a4015c79 (diff)
Linux integration tests: Verify device types
Check "Type" property for AC (1), battery (2), and UPS (3).
-rwxr-xr-xsrc/linux/integration-test4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/linux/integration-test b/src/linux/integration-test
index 57629da..e4f63b7 100755
--- a/src/linux/integration-test
+++ b/src/linux/integration-test
@@ -209,6 +209,7 @@ class Tests(unittest.TestCase):
self.assertEqual(self.get_dbus_property('OnBattery'), False)
self.assertEqual(self.get_dbus_property('OnLowBattery'), False)
self.assertEqual(self.get_dbus_dev_property(ac_up, 'PowerSupply'), True)
+ self.assertEqual(self.get_dbus_dev_property(ac_up, 'Type'), 1)
self.assertEqual(self.get_dbus_dev_property(ac_up, 'Online'), True)
self.assertEqual(self.get_dbus_dev_property(ac_up, 'NativePath'), ac)
self.stop_daemon()
@@ -263,6 +264,7 @@ class Tests(unittest.TestCase):
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'State'), UP_DEVICE_STATE_DISCHARGING)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Percentage'), 2.5)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'PowerSupply'), True)
+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), 2)
self.stop_daemon()
# now connect AC again
@@ -436,6 +438,7 @@ class Tests(unittest.TestCase):
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Voltage'), 12.0)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'NativePath'), bat0)
self.assertEqual(self.get_dbus_dev_property(bat0_up, 'PowerSupply'), True)
+ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), 2)
self.assertEqual(self.get_dbus_property('OnBattery'), True)
self.assertEqual(self.get_dbus_property('OnLowBattery'), False)
@@ -486,6 +489,7 @@ class Tests(unittest.TestCase):
self.assertEqual(self.get_dbus_dev_property(ups0_up, 'Percentage'), 70.0)
self.assertEqual(self.get_dbus_dev_property(ups0_up, 'State'), UP_DEVICE_STATE_CHARGING)
self.assertEqual(self.get_dbus_dev_property(ups0_up, 'PowerSupply'), True)
+ self.assertEqual(self.get_dbus_dev_property(ups0_up, 'Type'), 3)
self.assertEqual(self.get_dbus_property('OnBattery'), False)
self.assertEqual(self.get_dbus_property('OnLowBattery'), False)