diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-09 18:14:32 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-09 18:14:32 +0100 |
| commit | 9047e5420a59b43ef35ae95abb8264768761fcab (patch) | |
| tree | d6e30a2d94feb9ac4acc6e0ee79de9032867b417 /tests/test_stats.py | |
| parent | 1cd822b825145d921d678c27b0600c78e576826b (diff) | |
| download | deck-it-9047e5420a59b43ef35ae95abb8264768761fcab.tar.gz deck-it-9047e5420a59b43ef35ae95abb8264768761fcab.zip | |
feat: stats module
Diffstat (limited to 'tests/test_stats.py')
| -rw-r--r-- | tests/test_stats.py | 25 |
1 files changed, 25 insertions, 0 deletions
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() |
