zulip_botserver: Add test to check two bots working together.

This commit is contained in:
dkvasov 2018-05-16 19:33:01 +03:00 committed by Tim Abbott
parent 2de862cdcd
commit d3b99959c6

View file

@ -28,6 +28,25 @@ class BotServerTests(BotServerTestCase):
bots_config=bots_config, bots_config=bots_config,
check_success=True) 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: def test_bot_module_not_exists(self) -> None:
self.assert_bot_server_response(available_bots=[], self.assert_bot_server_response(available_bots=[],
payload_url="/bots/not_supported_bot", payload_url="/bots/not_supported_bot",