followup bot: Fix help response and configure streams.

From @showell:

We had a PR here with lots going on, and the commits weren't
very well organized, and then there were some tricky merge
conflicts from another PR.  So I just squashed them all into
one commit.

What this does:
    * allow you to configure your followup stream
    * provide help in followup stream
    * add more testing to followup stream
    * add get_response() helper for tests

Fixes #173
Fixes #174
This commit is contained in:
Nikhil Mishra 2017-12-09 04:04:21 +05:30 committed by Steve Howell
parent 1cdb0bffe6
commit 81b207795f
4 changed files with 72 additions and 21 deletions

View file

@ -100,6 +100,18 @@ class StubBotTestCase(TestCase):
bot_name = ''
def get_response(self, message):
# type: (Dict[str, Any]) -> Dict[str, Any]
bot = get_bot_message_handler(self.bot_name)
bot_handler = StubBotHandler()
if hasattr(bot, 'initialize'):
bot.initialize(bot_handler)
bot_handler.reset_transcript()
bot.handle_message(message, bot_handler)
return bot_handler.unique_response()
def verify_reply(self, request, response):
# type: (str, str) -> None