From 624a7a845c601990f5550a3cb3db38b139feb5da Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 10 Nov 2026 18:20:15 +0100 Subject: feat(stats): processor and card names, both network rates large The CPU tile is labelled with /proc/cpuinfo's model name, trimmed of core counts and trademarks; the GPU tile with lspci's marketing name for the xe card. The network tile shows download and upload side by side at the same size. Co-Authored-By: Claude Opus 5.5 --- tests/test_stats.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/test_stats.py') diff --git a/tests/test_stats.py b/tests/test_stats.py index 1a28ae8..f32bfac 100644 --- a/tests/test_stats.py +++ b/tests/test_stats.py @@ -37,6 +37,22 @@ class Stats(unittest.TestCase): self.assertIn("stats", names) +class Names(unittest.TestCase): + def test_cpu_name(self): + self.assertEqual(stats._cpu_name("model name\t: AMD Ryzen 7 9700X 8-Core Processor\n"), + "AMD Ryzen 7 9700X") + self.assertEqual(stats._cpu_name("model name : Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz"), + "Intel Core i7-8550U") + self.assertIsNone(stats._cpu_name("")) + + def test_gpu_name(self): + line = ('03:00.0 "VGA compatible controller" "Intel Corporation" ' + '"Battlemage G21 [Arc B580]" -p00 "Vendor" "Device 4215"') + self.assertEqual(stats._gpu_name(line), "Intel Arc B580") + self.assertEqual(stats._gpu_name('03:00.0 "VGA" "Intel Corporation" "DG2"'), "Intel DG2") + self.assertIsNone(stats._gpu_name("")) + + class Intel(unittest.TestCase): def test_parse_bytes(self): self.assertEqual(stats._parse_bytes("12G"), 12 * 1024 ** 3) -- cgit v1.2.3