def test_parse_string(self): pq = PostfixMailQueue(mailq_data_generator) try: pq.update() self.assertTrue(True) except MailQueueDataFetchError: self.assertTrue(False)
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)
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 )