aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_stats.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-11 09:53:37 +0100
committerDanilo M. <danix@danix.xyz>2026-11-11 09:53:37 +0100
commit978ec811803cdbeb10dc2e6924ab33aa2b84bec6 (patch)
treea9c217da32594492f43be941fca139d7950d7cbd /tests/test_stats.py
parent085eaa7d3876fa0c9f5d5390bfe2395b85e46b62 (diff)
downloaddeck-it-978ec811803cdbeb10dc2e6924ab33aa2b84bec6.tar.gz
deck-it-978ec811803cdbeb10dc2e6924ab33aa2b84bec6.zip
feat(dashboard): pending updates in the system row, icons, opencode logo
The system row now ends with "N updates available", keystone's "to install" count from updatesctl ([dashboard] updates; empty hides it). stats re-reads it in a thread every 5 minutes, so the NFS reads behind it never stall the 1 s poll. The codename reads "-current" next to the OS name, so it no longer looks like part of the kernel. Kernel and uptime get tux and clock icons, the row is tighter, and its separators are a "|" in the first Hyprland border colour instead of an unreadable dot. The opencode spending card shows the opencode logo by its title. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_stats.py')
-rw-r--r--tests/test_stats.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_stats.py b/tests/test_stats.py
index f732054..f45a0cd 100644
--- a/tests/test_stats.py
+++ b/tests/test_stats.py
@@ -31,6 +31,11 @@ class Stats(unittest.TestCase):
self.assertIn(key, st)
self.assertIsInstance(st["cpu"], int)
+ def test_to_install_counts_like_keystone(self):
+ doc = {"slackware": {"upgrade": [1, 2], "new": [3], "removed": [4]},
+ "upgrade": [5], "build": [6, 7], "upstream": [8], "apps": [9]}
+ self.assertEqual(stats._to_install(doc), 5)
+
def test_build_discovers_stats(self):
from deckit.modules import build
names = [m["name"] for m in build({"modules": {}}).names()]