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:
parent
1cdb0bffe6
commit
81b207795f
4 changed files with 72 additions and 21 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue