Skip to content

Commit 749356d

Browse files
neiljptimabbott
authored andcommitted
Incrementor tests: Preliminary coverage with no update_message support.
1 parent d8c4242 commit 749356d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env python
2+
3+
from __future__ import absolute_import
4+
from __future__ import print_function
5+
6+
from zulip_bots.test_lib import BotTestCase
7+
from zulip_bots.lib import StateHandler
8+
9+
10+
class TestIncrementorBot(BotTestCase):
11+
bot_name = "incrementor"
12+
13+
def test_bot(self):
14+
messages = [ # Template for message inputs to test, absent of message content
15+
{
16+
'type': 'stream',
17+
'display_recipient': 'some stream',
18+
'subject': 'some subject',
19+
'sender_email': '[email protected]',
20+
},
21+
{
22+
'type': 'private',
23+
'sender_email': '[email protected]',
24+
},
25+
]
26+
state_handler = StateHandler()
27+
self.assert_bot_response(dict(messages[0], content=""), {'content': "1"},
28+
'send_reply', state_handler)
29+
# Last test commented out since we don't have update_message
30+
# support in the test framework yet.
31+
32+
# self.assert_bot_response(dict(messages[0], content=""), {'message_id': 5, 'content': "2"},
33+
# 'update_message', state_handler)

0 commit comments

Comments
 (0)