Skip to content

Commit 36b2c13

Browse files
committed
tests: Relax libnotify expected format for libnotify 0.8.4
That version moves the icon from a positional to an optional argument, so accept both cases.
1 parent 05aa910 commit 36b2c13

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Diff for: tests/test_notification_daemon.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,11 @@ def test_options(self):
6060
subprocess.check_call(["notify-send", "-t", "27", "-a", "fooApp", "-i", "warning_icon", "title", "my text"])
6161
log = self.p_mock.stdout.read()
6262
# HACK: Why is the timeout missing on s390x?
63-
if os.uname().machine == "s390x":
64-
self.assertRegex(
65-
log, b'[0-9.]+ Notify "fooApp" 0 "warning_icon" "title" "my text" \\[\\] {.*"urgency": 1'
66-
)
67-
else:
68-
self.assertRegex(
69-
log, b'[0-9.]+ Notify "fooApp" 0 "warning_icon" "title" "my text" \\[\\] {.*"urgency": 1.* 27\n'
70-
)
63+
if os.uname().machine != "s390x":
64+
self.assertRegex(log, rb"[0-9.]+ Notify.* 27\n")
65+
# libnotify 0.8.4 changes warning_icon from positional to optional argument, so check that separately
66+
self.assertRegex(log, rb'[0-9.]+ Notify "fooApp" 0 "(warning_icon)?" "title" "my text" \[\] {.*"urgency": 1')
67+
self.assertRegex(log, rb"[0-9.]+ Notify .*warning_icon")
7168

7269
def test_id(self):
7370
"""ID handling"""

0 commit comments

Comments
 (0)