From d3b99959c6fe808a1f5c7399cdba2c700da96633 Mon Sep 17 00:00:00 2001 From: dkvasov Date: Wed, 16 May 2018 19:33:01 +0300 Subject: [PATCH] zulip_botserver: Add test to check two bots working together. --- zulip_botserver/tests/test_server.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/zulip_botserver/tests/test_server.py b/zulip_botserver/tests/test_server.py index 26bb14b..ce4d6c7 100644 --- a/zulip_botserver/tests/test_server.py +++ b/zulip_botserver/tests/test_server.py @@ -28,6 +28,25 @@ class BotServerTests(BotServerTestCase): bots_config=bots_config, check_success=True) + @mock.patch('zulip_botserver.server.ExternalBotHandler') + def test_successful_request_from_two_bots(self, mock_ExternalBotHandler: mock.Mock) -> None: + available_bots = ['helloworld', 'help'] + bots_config = { + 'helloworld': { + 'email': 'helloworld-bot@zulip.com', + 'key': '123456789qwertyuiop', + 'site': 'http://localhost', + }, + 'help': { + 'email': 'help-bot@zulip.com', + 'key': '123456789qwertyuiop', + 'site': 'http://localhost', + } + } + self.assert_bot_server_response(available_bots=available_bots, + bots_config=bots_config, + check_success=True) + def test_bot_module_not_exists(self) -> None: self.assert_bot_server_response(available_bots=[], payload_url="/bots/not_supported_bot",