mirror of
https://github.com/nicolabs/nicobot.git
synced 2026-02-22 18:25:21 +01:00
+ test on max_count
This commit is contained in:
parent
6d3162cf2d
commit
95e142ea81
|
|
@ -9,6 +9,24 @@ from nicobot.console import ConsoleChatter
|
|||
|
||||
class TestAskbot(unittest.TestCase):
|
||||
|
||||
def test_end_on_max_count(self):
|
||||
bot = AskBot(
|
||||
chatter = ConsoleChatter( input=["One","Two","Three"] ),
|
||||
message = "Let's count !",
|
||||
patterns=[
|
||||
[ "four", r'(?i)\bfour\b' ],
|
||||
],
|
||||
max_count=3
|
||||
)
|
||||
result = bot.run()
|
||||
expected = {'max_count': True, 'events': [
|
||||
{'message': 'One', 'matched_patterns': []},
|
||||
{'message': 'Two', 'matched_patterns': []},
|
||||
{'message': 'Three', 'matched_patterns': []}]
|
||||
}
|
||||
self.assertEqual(expected,result)
|
||||
|
||||
|
||||
def test_end_on_yes(self):
|
||||
bot = AskBot(
|
||||
chatter = ConsoleChatter( input=["Yes !"] ),
|
||||
|
|
|
|||
Loading…
Reference in a new issue