zulip_bots: Rename state_handler to storage.
This commit is contained in:
parent
eb6982e670
commit
e331426c64
7 changed files with 21 additions and 21 deletions
|
@ -12,7 +12,7 @@ class IncrementorHandler(object):
|
|||
'''
|
||||
|
||||
def handle_message(self, message, bot_handler):
|
||||
with bot_handler.state_handler.state({'number': 0, 'message_id': None}) as state:
|
||||
with bot_handler.storage.state({'number': 0, 'message_id': None}) as state:
|
||||
state['number'] += 1
|
||||
if state['message_id'] is None:
|
||||
result = bot_handler.send_reply(message, str(state['number']))
|
||||
|
|
|
@ -23,11 +23,11 @@ class TestIncrementorBot(BotTestCase):
|
|||
'sender_email': 'foo_sender@zulip.com',
|
||||
},
|
||||
]
|
||||
state_handler = StateHandler()
|
||||
storage = StateHandler()
|
||||
self.assert_bot_response(dict(messages[0], content=""), {'content': "1"},
|
||||
'send_reply', state_handler)
|
||||
'send_reply', storage)
|
||||
# Last test commented out since we don't have update_message
|
||||
# support in the test framework yet.
|
||||
|
||||
# self.assert_bot_response(dict(messages[0], content=""), {'message_id': 5, 'content': "2"},
|
||||
# 'update_message', state_handler)
|
||||
# 'update_message', storage)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue