-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_status.py
32 lines (25 loc) · 1.04 KB
/
test_status.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import unittest
from argo_probe_argo_tools.status import Status
class StatusTests(unittest.TestCase):
def setUp(self):
self.status = Status()
def test_ok(self):
self.status.ok("Everything is ok")
self.assertEqual(self.status.get_msg(), "OK - Everything is ok")
self.assertEqual(self.status.get_code(), 0)
def test_warning(self):
self.status.warning("This is the final warning")
self.assertEqual(
self.status.get_msg(), "WARNING - This is the final warning"
)
self.assertEqual(self.status.get_code(), 1)
def test_critical(self):
self.status.critical("Something is wrong")
self.assertEqual(self.status.get_msg(), "CRITICAL - Something is wrong")
self.assertEqual(self.status.get_code(), 2)
def test_unknown(self):
self.status.unknown("I don't know what is happening")
self.assertEqual(
self.status.get_msg(), "UNKNOWN - I don't know what is happening"
)
self.assertEqual(self.status.get_code(), 3)