From f1b3e943c6c8cec51368e5da1704272ae22b2616 Mon Sep 17 00:00:00 2001 From: neiljp Date: Mon, 19 Jun 2017 14:42:49 -0700 Subject: [PATCH] Extend message parameters passed in check_expected_responses --- api/bots_api/bots_test_lib.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/bots_api/bots_test_lib.py b/api/bots_api/bots_test_lib.py index 0bbe33f0b4..e9e552be29 100644 --- a/api/bots_api/bots_test_lib.py +++ b/api/bots_api/bots_test_lib.py @@ -58,8 +58,8 @@ class BotTestCase(TestCase): def check_expected_responses(self, expectations, expected_method='send_reply', email="foo_sender@zulip.com", recipient="foo", subject="foo", - type="all"): - # type: (Dict[str, Any], str, str, str, str, str) -> None + sender_id=0, sender_full_name="Foo Bar", type="all"): + # type: (Dict[str, Any], str, str, str, str, int, str, str) -> None # To test send_message, Any would be a Dict type, # to test send_reply, Any would be a str type. if type not in ["private", "stream", "all"]: @@ -71,11 +71,13 @@ class BotTestCase(TestCase): response = {'content': r} if expected_method == 'send_reply' else r if type != "stream": message = {'content': m, 'type': "private", 'display_recipient': recipient, - 'sender_email': email} + 'sender_email': email, 'sender_id': sender_id, + 'sender_full_name': sender_full_name} self.assert_bot_response(message=message, response=response, expected_method=expected_method) if type != "private": message = {'content': m, 'type': "stream", 'display_recipient': recipient, - 'subject': subject, 'sender_email': email} + 'subject': subject, 'sender_email': email, 'sender_id': sender_id, + 'sender_full_name': sender_full_name} self.assert_bot_response(message=message, response=response, expected_method=expected_method) def call_request(self, message, expected_method, response):