[gnome-settings-daemon/wip/carlosg/fix-tests-3-34: 2/2] power: Make notification message regexps in tests more generic



commit f7e473df186ad866fc8227df550ddfc2cb85d03d
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.

 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]