From 9047e5420a59b43ef35ae95abb8264768761fcab Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 9 Nov 2026 18:14:32 +0100 Subject: feat: stats module --- tests/test_stats.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/test_stats.py (limited to 'tests/test_stats.py') diff --git a/tests/test_stats.py b/tests/test_stats.py new file mode 100644 index 0000000..fad6cc2 --- /dev/null +++ b/tests/test_stats.py @@ -0,0 +1,25 @@ +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) + +import unittest + +import deckit.modules.stats as stats + + +class Stats(unittest.TestCase): + def test_state_shape(self): + st = stats.make({}).state() + for key in ("cpu", "memUsed", "memTotal", "net", "uptime", "host"): + self.assertIn(key, st) + self.assertIsInstance(st["cpu"], int) + + def test_build_discovers_stats(self): + from deckit.modules import build + names = [m["name"] for m in build({"modules": {}}).names()] + self.assertIn("stats", names) + + +if __name__ == "__main__": + unittest.main() -- cgit v1.2.3