diff options
author | nicolargo <nicolas@nicolargo.com> | 2022-03-12 15:20:57 +0100 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2022-03-12 15:21:21 +0100 |
commit | 6d9bac1867bbb7bfd62e1b8a8c129d26dbfc18d9 (patch) | |
tree | d565eadf13638977173c0d06d94920e24ccee9b8 /unitest.py | |
parent | 7e2af7bd63be2b500418e057009a8c4d58b739a4 (diff) |
First running version. Need more test. And WebUI
Diffstat (limited to 'unitest.py')
-rwxr-xr-x | unitest.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -34,6 +34,7 @@ from glances.thresholds import GlancesThresholdWarning from glances.thresholds import GlancesThresholdCritical from glances.thresholds import GlancesThresholds from glances.plugins.glances_plugin import GlancesPlugin +from glances.programs import processes_to_programs from glances.compat import subsample, range from glances.secure import secure_popen from glances.compat import PY3 @@ -283,6 +284,16 @@ class TestGlances(unittest.TestCase): print('INFO: SMART stats: %s' % stats_grab) + def test_017_programs(self): + """Check Programs function (it's not a plugin).""" + # stats_to_check = [ ] + print('INFO: [TEST_010] Check PROGRAM stats') + stats_grab = processes_to_programs(stats.get_plugin('processlist').get_raw()) + self.assertTrue(type(stats_grab) is list, msg='Programs stats is not a list') + print('INFO: PROGRAM list stats: %s items in the list' % len(stats_grab)) + # Check if number of processes in the list equal counter + # self.assertEqual(total, len(stats_grab)) + def test_094_thresholds(self): """Test thresholds classes""" print('INFO: [TEST_094] Thresholds') |