aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_stats.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_stats.py')
-rw-r--r--tests/test_stats.py16
1 files changed, 16 insertions, 0 deletions
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)