示例#1
0
 def testYes(self):
     """ Test with an always true recognizer. """
     manager = RecognizerManager([YesRecognizer()])
     yeses, maybes = manager.processEntry(None, [])
     self.assertEqual(len(yeses), 1)
     self.assertEqual(maybes, [])
示例#2
0
 def testLazy(self):
     """ Test with a lazy recognizer. """
     manager = RecognizerManager([LazyRecognizer()])
     yeses, maybes = manager.processEntry(None, [])
     self.assertEqual(yeses, [])
     self.assertEqual(len(maybes), 1)
示例#3
0
 def testEmpty(self):
     """ Test that an entry w/out any recognizers is correctly processed. """
     manager = RecognizerManager([])
     yeses, maybes = manager.processEntry(None, [])
     self.assertEqual(yeses, [])
     self.assertEqual(maybes, [])