Пример #1
0
 def test_prefixText(self):
     eo = NagErrors()
     ev = NagEval(eo)
     ev.evalNumberDesc(45, warningBelow=50, postfixText=" Units")
     self.assertEqual(eo.warning[0], "45 is < 50 Units")
Пример #2
0
 def test_numberUnits(self):
     eo = NagErrors()
     ev = NagEval(eo)
     ev.evalNumberDesc(45, warningBelow=50, numberUnits="sec")
     self.assertEqual(eo.warning[0], "45sec is < 50sec")
Пример #3
0
 def test_negative_high(self):
     eo = NagErrors()
     ev = NagEval(eo)
     ev.evalNumberDesc(-3, warningBelow=-5, criticalBelow=-10)
     self.assertEqual(eo.getExitCode(), 0)
Пример #4
0
 def test_swappedTresholds(self):
     eo = NagErrors()
     ev = NagEval(eo)
     ev.evalNumberDesc(21, warningBelow=50, criticalBelow=40)
     self.assertEqual(eo.getExitCode(), 2)
Пример #5
0
 def test_high(self):
     eo = NagErrors()
     ev = NagEval(eo)
     ev.evalNumberDesc(55, warningBelow=50, criticalBelow=40)
     self.assertEqual(eo.getExitCode(), 0)