Esempio n. 1
0
 def test_parse_string(self):
     pq = PostfixMailQueue(mailq_data_generator)
     try:
         pq.update()
         self.assertTrue(True)
     except MailQueueDataFetchError:
         self.assertTrue(False)
Esempio n. 2
0
 def test_postfix_mailq(self):
     pf = PostfixMailqFetcher(True)
     pq = PostfixMailQueue(pf.get_data)
     try:
         pq.update()
         self.assertTrue(True)
     except MailQueueDataFetchError:
         self.assertTrue(False)
     except nagiosplugin.CheckError:
         self.assertTrue(False)
Esempio n. 3
0
 def test_counters(self):
     pq = PostfixMailQueue(mailq_data_generator)
     pq.update()
     self.assertTrue(
         pq.get_active_counter() == 2 and pq.get_deferred_counter() == 3 and pq.get_total_counter() == 6
     )