From 91f882df97adea262625a45be0257039f144ae49 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 20 Oct 2026 20:21:34 +0200 Subject: sbb-remote 0.9.0: SBo orphans tile on the Dashboard stats gains "orphans", the packages whose .info says MAINTAINER="orphaned - no maintainer" (0.14s over the tree on the VM). The placeholder tile shows the count and opens Packages with only the orphaned chip on. Co-Authored-By: Claude Opus 5.5 --- tests/test_gui.py | 8 ++++++++ tests/test_remote.py | 7 +++++++ 2 files changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/test_gui.py b/tests/test_gui.py index beec1fe..d005447 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -358,6 +358,14 @@ class SmokeTest(unittest.TestCase): self.assertEqual(w.conn.text(), "● VM off") self.assertFalse(w.vm_btn.isHidden()) + def test_orphans_tile_opens_filtered_packages(self): + w, _ = self.window(stats=(dict(STATS, orphans=1936), None)) + w.poll_jobs() + self.assertEqual(w.dashboard.orphans.value.text(), "1,936") + w.dashboard.orphans.clicked.emit() + self.assertIs(w.tabs.currentWidget(), w.packages_tab) + self.assertEqual([n for n, c in w.packages_tab.chips.items() if c.isChecked()], ["orphaned"]) + def test_slackpkg_dot(self): old = dict(STATS, slackpkg={"update": None, "upgrade": 1}) w, _ = self.window(stats=(old, None)) diff --git a/tests/test_remote.py b/tests/test_remote.py index 30bdc73..7288828 100644 --- a/tests/test_remote.py +++ b/tests/test_remote.py @@ -779,12 +779,19 @@ class JobsTest(Base): class StatsTest(Base): + def test_orphans(self): + self.make_pkg("net/a", 'MAINTAINER="orphaned - no maintainer"\nEMAIL="NOEMAIL"\n') + self.make_pkg("net/b", 'MAINTAINER="Someone"\n') + self.make_pkg("personal/c", 'PRGNAM="c"\nMAINTAINER="orphaned - no maintainer"\n') + self.assertEqual(sbb._orphans(self.cfg), 2) + def test_missing_sources_are_null(self): s = sbb.cmd_stats(self.cfg) self.assertIsNotNone(s["load"]) self.assertEqual(set(s["disk"]), {"total", "free"}) self.assertIn("slackpkg", s) self.assertIsNone(s["packages"]) + self.assertIsNone(s["orphans"]) self.assertIsNone(s["slackrepo"]) self.assertEqual(s["sync"], {"personal": None, "pentesting": None}) json.dumps(s) -- cgit v1.2.3