Rename assert_bot_server_response param `message` to `event`.
It's an event, not a message.
MODIFY
zulip_botserver/tests/server_test_lib.py
zulip_botserver/tests/server_test_lib.py
@@ -17,7 +17,7 @@ class BotServerTestCase(TestCase):
available_bots: Optional[List[str]]=None,
bots_config: Optional[Dict[str, Dict[str, str]]]=None,
bot_handlers: Optional[Dict[str, Any]]=None,
- message: Optional[Dict[str, Any]]=None,
+ event: Optional[Dict[str, Any]]=None,
check_success: bool=False,
third_party_bot_conf: Optional[configparser.ConfigParser]=None,
) -> None:
@@ -31,7 +31,7 @@ class BotServerTestCase(TestCase):
server.app.config["BOT_HANDLERS"] = bot_handlers
server.app.config["MESSAGE_HANDLERS"] = message_handlers
- response = self.app.post(data=json.dumps(message))
+ response = self.app.post(data=json.dumps(event))
if check_success:
assert 200 <= response.status_code < 300

MODIFY
zulip_botserver/tests/test_server.py
zulip_botserver/tests/test_server.py
@@ -31,7 +31,7 @@ class BotServerTests(BotServerTestCase):
}
self.assert_bot_server_response(available_bots=available_bots,
bots_config=bots_config,
- message=dict(message={'content': "test message"},
+ event=dict(message={'content': "test message"},
bot_email='helloworld-bot@zulip.com'),
check_success=True)
@@ -51,14 +51,14 @@ class BotServerTests(BotServerTestCase):
}
}
self.assert_bot_server_response(available_bots=available_bots,
- message=dict(message={'content': "test message"},
+ event=dict(message={'content': "test message"},
bot_email='helloworld-bot@zulip.com'),
bots_config=bots_config,
check_success=True)
def test_bot_module_not_exists(self) -> None:
self.assert_bot_server_response(available_bots=[],
- message=dict(message={'content': "test message"},
+ event=dict(message={'content': "test message"},
bot_email='nonexistent-bot@zulip.com'),
check_success=False)
@@ -81,7 +81,7 @@ class BotServerTests(BotServerTestCase):
"make sure you have set up the flaskbotrc file correctly.",
lambda: self.assert_bot_server_response(
available_bots=available_bots,
- message=dict(message={'content': "test message"},
+ event=dict(message={'content': "test message"},
bot_email='helloworld-bot@zulip.com'),
bots_config=bots_config))

Rename assert_bot_server_response param `message` to `event`.

It's an event, not a message.