Commit 422f8c18 authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

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: #445
parent c8807941
Pipeline #113582 failed with stages
in 2 minutes and 9 seconds
......@@ -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'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment