From cbdac3da5b61e5258e3221286b5f2e8a582cd92c Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 8 Sep 2022 11:38:21 +0200 Subject: [PATCH] tests: Add tests for checking for profile existence --- tests/integration-test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/integration-test.py b/tests/integration-test.py index 77e05c0..012adba 100755 --- a/tests/integration-test.py +++ b/tests/integration-test.py @@ -320,6 +320,13 @@ class Tests(dbusmock.DBusTestCase): self.set_dbus_property('ActiveProfile', GLib.Variant.new_string('power-saver')) self.assertEqual(self.get_dbus_property('ActiveProfile'), 'power-saver') + with self.assertRaises(gi.repository.GLib.GError): + self.set_dbus_property('ActiveProfile', GLib.Variant.new_string('performance')) + self.assertEqual(self.get_dbus_property('ActiveProfile'), 'power-saver') + + with self.assertRaises(gi.repository.GLib.GError): + cookie = self.call_dbus_method('HoldProfile', GLib.Variant("(sss)", ('performance', 'testReason', 'testApplication'))) + # process = subprocess.Popen(['gdbus', 'introspect', '--system', '--dest', 'net.hadess.PowerProfiles', '--object-path', '/net/hadess/PowerProfiles']) # print (self.get_dbus_property('GPUs'))