bots: Make StateHandler store state on Zulip server.
This makes the StateHandler functional. To reduce the number of server roundtrips when fetching/updating the state, the entire state is fetched ocne at bot initialization and cached. All changes are stored in the cache and only saved externally after handle_message() has been executed. Fixes #141.
This commit is contained in:
parent
979bbb1c14
commit
2736223073
3 changed files with 32 additions and 8 deletions
|
@ -39,8 +39,9 @@ class BotServerTests(BotServerTestCase):
|
|||
check_success=False)
|
||||
|
||||
@mock.patch('logging.error')
|
||||
def test_wrong_bot_credentials(self, mock_LoggingError):
|
||||
# type: (mock.Mock) -> None
|
||||
@mock.patch('zulip_bots.lib.StateHandler')
|
||||
def test_wrong_bot_credentials(self, mock_StateHandler, mock_LoggingError):
|
||||
# type: (mock.Mock, mock.Mock) -> None
|
||||
available_bots = ['nonexistent-bot']
|
||||
bots_config = {
|
||||
'nonexistent-bot': {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue