From d3199b32038237cca20c6881c8374352b3115d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 2 Apr 2024 20:24:24 +0200 Subject: [PATCH] integration-tests: Simulate OnBattery changes while the daemon is running --- tests/integration_test.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/integration_test.py b/tests/integration_test.py index fe5866f..3c2332e 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -1341,13 +1341,19 @@ class Tests(dbusmock.DBusTestCase): self.assert_file_eventually_contains(energy_prefs, "balance_performance") - self.start_dbus_template( + _, upowerd_obj, _ = self.start_dbus_template( "upower", {"DaemonVersion": "0.99", "OnBattery": False}, ) self.assert_file_eventually_contains(energy_prefs, "balance_performance") + upowerd_obj.Set("org.freedesktop.UPower", "OnBattery", True) + self.assert_file_eventually_contains(energy_prefs, "balance_power") + + upowerd_obj.Set("org.freedesktop.UPower", "OnBattery", False) + self.assert_file_eventually_contains(energy_prefs, "balance_performance") + def test_amdgpu_panel_power(self): """Verify AMDGPU Panel power actions""" amdgpu_panel_power_savings = "amdgpu/panel_power_savings"