aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-20 11:43:02 +0200
committerDanilo M. <danix@danix.xyz>2026-10-20 11:43:02 +0200
commit5be93186f2a8ee04aa1fdc392a7e4bf0f513155e (patch)
treeeeeb4618dad73f51232eaf23d864cb95ab5d8c5f /tests
parentdddf9edde7ad89ba358af482e7206749d9e16426 (diff)
downloadsb-builder-5be93186f2a8ee04aa1fdc392a7e4bf0f513155e.tar.gz
sb-builder-5be93186f2a8ee04aa1fdc392a7e4bf0f513155e.zip
Hints: Delete hint acts on the ticked packages, then offers Revert
Rows with only a stanza have no hint and are skipped. The deletes open the same dialog as a hint job: each removed hint's diff and Revert, which had no place in the GUI before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gui.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_gui.py b/tests/test_gui.py
index d45fffd..1f3f7b0 100644
--- a/tests/test_gui.py
+++ b/tests/test_gui.py
@@ -513,6 +513,18 @@ class SmokeTest(unittest.TestCase):
self.assertEqual(tab.table.item(row, 5).toolTip(), "HTTPError(404)")
self.assertIs(w.open_hints("foo"), tab)
self.assertEqual(tab.current(), "foo")
+ tab.check_rows(False)
+ tab.confirm = lambda title, text: self.fail("asked with nothing to delete")
+ tab.delete() # nothing ticked
+ tab.check_rows(True) # foo has a hint; nuclei and curl have only a stanza
+ asked = []
+ tab.confirm = lambda title, text: asked.append(text) or True
+ remote.answers["hint-diff"] = ({"bak": "A=1\n", "current": None}, None)
+ tab.delete()
+ self.assertIn("1 package(s): foo", asked[0])
+ self.assertEqual([c for c in remote.calls if c[0] == "hint-delete"], [("hint-delete", "foo")])
+ self.assertEqual(len(w.hint_dialogs), 1) # Revert lives there
+ self.assertIn("-A=1", w.hint_dialogs[0].diff.toPlainText())
def test_hint_job_end_opens_diff(self):
job = dict(JOB, id="20260101-000000-hint-update", kind="hint-update", args=["nuclei=3.12.0"])