diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_gui.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test_gui.py b/tests/test_gui.py index d005447..eef9c5d 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -154,6 +154,7 @@ INVENTORY = {"columns": COLS, "rows": [ inv_row("personal/foo", built="1.0", result="ok", hints={"DELREQUIRES": "x"}, requires=["x", "y"]), inv_row("pentesting/nmap", built="7.9", result="bad"), inv_row("network/curl", maintainer="orphaned - no maintainer"), + inv_row("system/borgbackup", "1.4.2", built="1.4.5", result="ok"), ]} RESULTS = {"rows": [["games/pcsx2", "failed", 1789992366, None, True], # newest first, as the helper ["development/whisper.cpp", "aborted", 1789753147, None, False], @@ -245,7 +246,15 @@ class FilterTest(unittest.TestCase): def test_status(self): self.assertEqual({n: r["status"] for n, r in self.rows.items()}, - {"nuclei": "outdated", "foo": "ok", "nmap": "failed", "curl": "never"}) + {"nuclei": "outdated", "foo": "ok", "nmap": "failed", "curl": "never", + "borgbackup": "newer"}) + + def test_vercmp(self): + for a, b, want in (("1.0", "1.0", 0), ("1.4.10", "1.4.9", 1), ("1.0rc1", "1.0", -1), + ("1.0.1", "1.0", 1), ("4.3.5b", "4.3.5", 1), ("1_0", "1.0", 0), + ("2.0beta", "2.0alpha", 1), ("1.0a", "1.0.1", -1), ("", "1.0", -1)): + self.assertEqual(pk.vercmp(a, b), want, (a, b)) + self.assertEqual(pk.vercmp(b, a), -want, (b, a)) def test_query(self): self.assertEqual(pk.parse_query("Nuc cat:misc bogus:x status:"), @@ -386,7 +395,7 @@ class SmokeTest(unittest.TestCase): w, remote = self.window(**{"job-start": ({"id": "20260101-000001-slackrepo"}, None)}) w.poll_jobs() tab = w.open_packages() - self.assertEqual(tab.proxy.rowCount(), 4) + self.assertEqual(tab.proxy.rowCount(), 5) self.assertFalse(tab.chips["failed"].icon().isNull()) # a dot in the table's color self.assertTrue(tab.chips["personal"].icon().isNull()) self.assertTrue(tab.query.isClearButtonEnabled()) @@ -413,7 +422,7 @@ class SmokeTest(unittest.TestCase): tab.model.checked.clear() select, clear = tab.keys select.activated.emit() - self.assertEqual(len(tab.model.checked), 4) + self.assertEqual(len(tab.model.checked), 5) clear.activated.emit() self.assertEqual(tab.model.checked, set()) tab.model.checked.update({"nuclei", "curl"}) |
