[gnome-settings-daemon/wip/carlosg/fix-tests-master: 2/2] power: Make notification message regexps in tests more generic
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/wip/carlosg/fix-tests-master: 2/2] power: Make notification message regexps in tests more generic
- Date: Mon, 9 Sep 2019 22:01:42 +0000 (UTC)
commit c778a3123635bc4adaaecca568d50b2f05b8454a
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Sep 9 14:35:32 2019 +0200
power: Make notification message regexps in tests more generic
The output format changed slightly in newer versions, some typing
information being embedded (eg. "dbus.UInt32(0)" vs. "0"). Those
integer arguments are not even what we are testing for here, so
make the regexes more generic to cater for old and new output
formats.
Closes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/445
plugins/power/test.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/power/test.py b/plugins/power/test.py
index 1faa7924..5e922f17 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -873,7 +873,7 @@ class PowerPluginTest6(PowerPluginBase):
notify_log = self.p_notify.stdout.read()
# verify notification
- self.assertRegex(notify_log, b'[0-9.]+ Notify "Power" 0 "battery-caution-symbolic" ".*battery
critical.*"')
+ self.assertRegex(notify_log, b'[0-9.]+ Notify "Power" .* "battery-caution-symbolic" ".*battery
critical.*"')
def test_notify_critical_battery_on_start(self):
'''action on critical battery on startup'''
@@ -889,7 +889,7 @@ class PowerPluginTest6(PowerPluginBase):
notify_log = self.p_notify.stdout.read()
# verify notification
- self.assertRegex(notify_log, b'[0-9.]+ Notify "Power" 0 "battery-caution-symbolic" ".*battery
critical.*"')
+ self.assertRegex(notify_log, b'[0-9.]+ Notify "Power" .* "battery-caution-symbolic" ".*battery
critical.*"')
def test_notify_device_battery(self):
'''critical power level notification for device batteries'''
@@ -940,7 +940,7 @@ class PowerPluginTest6(PowerPluginBase):
notify_log = self.p_notify.stdout.read()
# verify notification
- self.assertRegex(notify_log, b'[0-9.]+ Notify "Power" 0 ".*" ".*Wireless mouse .*low.* power.*"')
+ self.assertRegex(notify_log, b'[0-9.]+ Notify "Power" .* ".*" ".*Wireless mouse .*low.* power.*"')
def test_forced_logout(self):
'''Test forced logout'''
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]