def testYes(self): """ The manager recognizes every line. """ manager = RecognizerManager([YesRecognizer()]) reader = NullReader(10) scanner = LogScanner(reader, manager, NoneEjector) timer = FromTime(datetime.datetime.now(), [], scanner) yeses = list(timer.matches()) self.assertEqual(len(yeses), 10) yeses = list(timer.matches()) self.assertEqual(len(yeses), 10)
def testEmpty(self): """ The manager does not recognize, so no results. """ manager = RecognizerManager([]) reader = NullReader(10) scanner = LogScanner(reader, manager, NoneEjector) timer = FromTime(datetime.datetime.now(), [], scanner) yeses = list(timer.matches()) self.assertEqual(len(yeses), 0)