summaryrefslogtreecommitdiffstats
path: root/unitest.py
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2017-04-17 19:24:00 +0200
committernicolargo <nicolas@nicolargo.com>2017-04-17 19:24:00 +0200
commit14d07ae5d155a4dfe7ec31f693b6da48d1fb3d08 (patch)
treee4a7d61a3e1e4da62a2ad2461993732325f4165e /unitest.py
parenta2f97d56d3824145043c577c2423c93f650f0873 (diff)
Create the Glances threshold dict
Diffstat (limited to 'unitest.py')
-rwxr-xr-xunitest.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/unitest.py b/unitest.py
index fbbe38d6..1db2b0d9 100755
--- a/unitest.py
+++ b/unitest.py
@@ -32,6 +32,7 @@ from glances.thresholds import GlancesThresholdOk
from glances.thresholds import GlancesThresholdCareful
from glances.thresholds import GlancesThresholdWarning
from glances.thresholds import GlancesThresholdCritical
+from glances.thresholds import GlancesThresholds
# Global variables
# =================
@@ -211,7 +212,7 @@ class TestGlances(unittest.TestCase):
def test_094_thresholds(self):
"""Test thresholds classes"""
- print('INFO: [TEST_094] Mandatories methods')
+ print('INFO: [TEST_094] Thresholds')
ok = GlancesThresholdOk()
careful = GlancesThresholdCareful()
warning = GlancesThresholdWarning()
@@ -222,6 +223,9 @@ class TestGlances(unittest.TestCase):
self.assertFalse(ok > careful)
self.assertTrue(ok == ok)
self.assertTrue(str(ok) == 'OK')
+ thresholds = GlancesThresholds()
+ thresholds.add('cpu_percent', 'OK')
+ self.assertTrue(thresholds.get(stat_name='cpu_percent').description() == 'OK')
def test_095_methods(self):
"""Test mandatories methods"""
@@ -311,5 +315,6 @@ class TestGlances(unittest.TestCase):
stats.end()
self.assertTrue(True)
+
if __name__ == '__main__':
unittest.main()