mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-05-05 15:48:08 +02:00
tests: Add tests for quiet profile support
This commit is contained in:
parent
c9b646025d
commit
20a2d7f7b8
1 changed files with 22 additions and 0 deletions
|
|
@ -559,6 +559,28 @@ class Tests(dbusmock.DBusTestCase):
|
|||
|
||||
self.stop_daemon()
|
||||
|
||||
def test_quiet(self):
|
||||
# Uses cool instead of low-power
|
||||
acpi_dir = os.path.join(self.testbed.get_root_dir(), "sys/firmware/acpi/")
|
||||
os.makedirs(acpi_dir)
|
||||
with open(os.path.join(acpi_dir, "platform_profile") ,'w') as profile:
|
||||
profile.write("cool\n")
|
||||
with open(os.path.join(acpi_dir, "platform_profile_choices") ,'w') as choices:
|
||||
choices.write("quiet balanced balanced-performance performance\n")
|
||||
|
||||
self.start_daemon()
|
||||
profiles = self.get_dbus_property('Profiles')
|
||||
self.assertEqual(len(profiles), 3)
|
||||
self.assertEqual(profiles[0]['Driver'], 'platform_profile')
|
||||
self.assertEqual(profiles[0]['Profile'], 'power-saver')
|
||||
self.assertEqual(self.get_dbus_property('ActiveProfile'), 'balanced')
|
||||
self.assertEqual(self.read_sysfs_file("sys/firmware/acpi/platform_profile"), b'balanced')
|
||||
self.set_dbus_property('ActiveProfile', GLib.Variant.new_string('power-saver'))
|
||||
self.assertEqual(self.get_dbus_property('ActiveProfile'), 'power-saver')
|
||||
self.assertEqual(self.read_sysfs_file("sys/firmware/acpi/platform_profile"), b'quiet')
|
||||
|
||||
self.stop_daemon()
|
||||
|
||||
def test_hold_release_profile(self):
|
||||
self.create_platform_profile()
|
||||
self.start_daemon()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue