From 917bd8201928631cc15fdcc21bf4ff1489420b6e Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 10 Jan 2018 11:36:05 -0500 Subject: [PATCH] bot tests: Extract get_reply_dict() test helper. --- zulip_bots/zulip_bots/test_lib.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zulip_bots/zulip_bots/test_lib.py b/zulip_bots/zulip_bots/test_lib.py index 64322fe..18dc315 100755 --- a/zulip_bots/zulip_bots/test_lib.py +++ b/zulip_bots/zulip_bots/test_lib.py @@ -120,13 +120,18 @@ class BotTestCase(TestCase): ) return message - def verify_reply(self, request, response): - # type: (str, str) -> None + def get_reply_dict(self, request): + # type: (str) -> Dict[str, Any] bot, bot_handler = self._get_handlers() message = self.make_request_message(request) bot_handler.reset_transcript() bot.handle_message(message, bot_handler) reply = bot_handler.unique_reply() + return reply + + def verify_reply(self, request, response): + # type: (str, str) -> None + reply = self.get_reply_dict(request) self.assertEqual(response, reply['content']) def verify_dialog(self, conversation):