aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-20 19:21:24 +0200
committerDanilo M. <danix@danix.xyz>2026-10-20 19:21:24 +0200
commit32201a3d505b6b78da7ba15c2bb77093d52ec735 (patch)
tree46a82794db61cc101c77d856790ad0a290121c6f /tests
parent81604635b5a15ce36d14c04931ace058552ee2f3 (diff)
downloadsb-builder-32201a3d505b6b78da7ba15c2bb77093d52ec735.tar.gz
sb-builder-32201a3d505b6b78da7ba15c2bb77093d52ec735.zip
Notifications: icon per outcome, body says how the job went
Title is the job (kind and args), body the outcome: succeeded in, failed with exit code N after, killed after, lost. Icons are freedesktop names: emblem-default, dialog-error, process-stop, dialog-warning, computer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gui.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_gui.py b/tests/test_gui.py
index a25be37..beec1fe 100644
--- a/tests/test_gui.py
+++ b/tests/test_gui.py
@@ -126,8 +126,8 @@ class FakeNotifier(QObject):
super().__init__()
self.sent = []
- def send(self, title, body, jid=""):
- self.sent.append((title, body, jid))
+ def send(self, title, body, icon="", jid=""):
+ self.sent.append((title, body, icon, jid))
STATS = {"load": [0.5, 0.4, 0.3], "uptime": 3600.0, "cpu": 85.0,
@@ -344,10 +344,11 @@ class SmokeTest(unittest.TestCase):
def test_end_notification_once(self):
w, remote = self.window(jobs=({"jobs": [JOB]}, None))
w.poll_jobs()
- remote.answers["jobs"] = ({"jobs": [dict(JOB, status="failed", end=5, exit=1)]}, None)
+ remote.answers["jobs"] = ({"jobs": [dict(JOB, status="failed", end=125, exit=1)]}, None)
w.poll_jobs()
w.poll_jobs()
- self.assertEqual(w.notifier.sent, [("sb-builder: failed", "sbshadow --no", JOB["id"])])
+ self.assertEqual(w.notifier.sent, [("sbshadow --no", "Failed with exit code 1 after 2m 5s",
+ "dialog-error", JOB["id"])])
def test_down_offers_vm_start(self):
w, remote = self.window(jobs=(None, DOWN))
@@ -465,7 +466,7 @@ class SmokeTest(unittest.TestCase):
remote.answers["jobs"] = ({"jobs": [PREVIEW]}, None)
w.poll_jobs()
self.assertEqual(w.next_steps, {})
- self.assertEqual(w.notifier.sent[0][0], "sb-builder: finished")
+ self.assertEqual(w.notifier.sent[0][2], "emblem-default")
def test_shadow_preview_dialog_only_with_a_plan(self):
shadow = dict(PREVIEW, id="20260101-000000-sbshadow", kind="sbshadow", args=["--no"])