Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_bots: Extract helper for building the bot creation payload.

Niloth P9b571dac65e0
diff --git a/zerver/tests/test_bots.py b/zerver/tests/test_bots.py
index 63769fa63f3..c741a759fe9 100644
--- a/zerver/tests/test_bots.py
+++ b/zerver/tests/test_bots.py
@@ -66,14 +66,17 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
response_dict = self.assert_json_success(result)
self.assert_length(response_dict["bots"], count)
- def create_bot(self, **extras: Any) -> dict[str, Any]:
+ def bot_creation_info(self, **extras: Any) -> dict[str, Any]:
bot_info = {
"full_name": "The Bot of Hamlet",
"short_name": "hambot",
"bot_type": "1",
}
bot_info.update(extras)
- result = self.client_post("/json/bots", bot_info)
+ return bot_info
+
+ def create_bot(self, **extras: Any) -> dict[str, Any]:
+ result = self.client_post("/json/bots", self.bot_creation_info(**extras))
response_dict = self.assert_json_success(result)
return response_dict