aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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"])