summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2019-09-09 14:35:32 +0200
committerCarlos Garnacho <mrgarnacho@gmail.com>2019-09-09 22:07:17 +0000
commit422f8c184a31d976ea106156f71894791596e367 (patch)
tree4e04ce995e6f7e17664e555e5ba37f69f0d38a81
parentc88079418278823f089f06dc572b622c3d8218e6 (diff)
downloadgnome-settings-daemon-422f8c184a31d976ea106156f71894791596e367.tar.gz
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
-rwxr-xr-xplugins/power/test.py6
1 files 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'''