diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-21 10:07:37 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-21 10:07:42 +0200 |
| commit | 28b7d44e2d29d14ce2b9b30adecdf1bff3a71bf6 (patch) | |
| tree | 5f339562dc04f207c59c70151d7379d594e40dd8 /tests | |
| parent | 6b0f67655b40fef221f9c84cfb6c0bcedf34e3bb (diff) | |
| download | sb-builder-28b7d44e2d29d14ce2b9b30adecdf1bff3a71bf6.tar.gz sb-builder-28b7d44e2d29d14ce2b9b30adecdf1bff3a71bf6.zip | |
Repository: stats as Dashboard tiles
Packages, Size, Unpublished (opens the unpublished filter), Last publish,
in place of the one-line summary. CARD_STYLE moves to dashboard.py so
both tabs share it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_gui.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/test_gui.py b/tests/test_gui.py index a12efdd..08df339 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -381,10 +381,10 @@ class RepositoryTest(unittest.TestCase): def test_summary(self): s = repo.summary(repo.scan(self.root)) - self.assertIn("2 packages", s) - self.assertIn("3.0 KiB on disk", s) - self.assertIn("1 personal · 0 pentesting · 1 upstream", s) - self.assertIn("1 unpublished", s) + self.assertEqual(s["Packages"], ("2", "1 personal · 0 pentesting · 1 upstream")) + self.assertEqual(s["Size"], ("3.0 KiB", "40.0 KiB uncompressed")) + self.assertEqual(s["Unpublished"][0], "1") + self.assertTrue(s["Last publish"][0].endswith("ago")) def test_missing(self): with self.assertRaises(OSError): @@ -643,7 +643,10 @@ class SmokeTest(unittest.TestCase): tab = w.repository_tab w.tabs.setCurrentWidget(tab) self.wait(lambda: tab.model.rows) - self.assertIn("2 packages", tab.stats.text()) + self.assertEqual(tab.tiles["Packages"].value.text(), "2") + tab.tiles["Unpublished"].clicked.emit() # opens the unpublished filter + self.assertTrue(tab.chips["unpublished"].isChecked()) + tab.chips["unpublished"].setChecked(False) self.assertEqual(tab.proxy.rowCount(), 2) tab.chips["unpublished"].setChecked(True) self.assertEqual(tab.proxy.rowCount(), 1) |
