Commit graph

11 commits

Author SHA1 Message Date
neiljp (Neil Pilgrim) 438f711bb7 mypy: Amend typing of botserver test lib for strict-optional. 2018-01-02 14:05:33 -05:00
derAnfaenger 2736223073 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.
2017-11-18 08:58:47 -08:00
neiljp (Neil Pilgrim) d929cdb91e botserver testing: Move to six.assertRaisesRegex from Regexp variant.
This ensures 2/3 compatibility. The mypy test also now passes, though
the six stubs appear very minimal - maybe incorrect?
2017-11-15 13:43:08 -08:00
derAnfaenger fa9e5a8e26 zulip_botserver: Test for import error with wrong credentials. 2017-11-10 18:36:20 -08:00
derAnfaenger fb116259d0 zulip_botserver: Make tests more realistic.
Specifically, this invokes server.load_lib_modules()
and server.load_bot_handlers() to generate the modules
and handlers, instead of hardcoding them.
2017-11-10 18:36:20 -08:00
derAnfaenger bcc8bd7d38 zulip_botserver: Don't reinstantiate ExternalBotHandlers.
Fixes #147.
2017-11-07 05:06:12 -08:00
derAnfaenger e5576388dd botserver: Remove obsolete state_handler param from handle_message(). 2017-10-31 12:24:10 +01:00
Alena Volkova 81205ea813 mypy: zulip_botserver: Fix errors in tests/__init__.py. 2017-10-27 00:56:16 -04:00
derAnfaenger fb2aff4611 zulip package: Add unittest
As the first unittest, this creates a test directory and
abnd adds it tho the excluded pip package files.

There are two `tests` directories now, one in zulip_botserver and one in
zulip. This confuses the unittest runner, leading to failed test imports.
Therefore, we need to tell the package importer that there are multiple
tests directories, all of which should be considered for a search.
2017-09-12 01:27:09 -07:00
vaibhav c4876dddae bot server: Raise BadRequest when bot code can't be imported.
This adds support to check and raise a BadRequest when either the
configuration of bot couldn't be found or the BotHandler code of bot
couldn't be fetched. There can be cases where flaskbotrc contains config
details of a bot, but the user hasn't added it's handler class code. This
fixes server to handle such cases, by reporting it to user.
This also fixes the response of bot server to make it possible to skip
the response message.
2017-07-27 11:03:33 -07:00
Eeshan Garg 928d5ca16d flask_server: Move the server to its own package. 2017-07-18 01:31:54 -02:30