Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 3
0
 def test_negative_high(self):
     eo = NagErrors()
     ev = NagEval(eo)
     ev.evalNumberDesc(-3, warningBelow=-5, criticalBelow=-10)
     self.assertEqual(eo.getExitCode(), 0)
Ejemplo n.º 4
0
 def test_swappedTresholds(self):
     eo = NagErrors()
     ev = NagEval(eo)
     ev.evalNumberDesc(21, warningBelow=50, criticalBelow=40)
     self.assertEqual(eo.getExitCode(), 2)
Ejemplo n.º 5
0
 def test_high(self):
     eo = NagErrors()
     ev = NagEval(eo)
     ev.evalNumberDesc(55, warningBelow=50, criticalBelow=40)
     self.assertEqual(eo.getExitCode(), 0)