Remove default value from assert_bot_server_response message parameter.

This is the first step in validating the bot responses for the
botserver. The default value for `message` was nonsense and
wouldn't trigger a bot in real life. Additionally, we'll want
each test to use a proper message tailored to the test. Thus,
this commit removes a 'default' message alltogether.
This commit is contained in:
Robert Hönig 2018-05-28 17:26:02 +02:00 committed by Tim Abbott
parent 6a8cb2965c
commit 48f2c2ae36
2 changed files with 6 additions and 3 deletions

View file

@ -17,7 +17,7 @@ class BotServerTestCase(TestCase):
available_bots: Optional[List[str]]=None, available_bots: Optional[List[str]]=None,
bots_config: Optional[Dict[str, Dict[str, str]]]=None, bots_config: Optional[Dict[str, Dict[str, str]]]=None,
bot_handlers: Optional[Dict[str, Any]]=None, bot_handlers: Optional[Dict[str, Any]]=None,
message: Optional[Dict[str, Any]]=dict(message={'key': "test message"}), message: Optional[Dict[str, Any]]=None,
check_success: bool=False, check_success: bool=False,
third_party_bot_conf: Optional[configparser.ConfigParser]=None, third_party_bot_conf: Optional[configparser.ConfigParser]=None,
) -> None: ) -> None:

View file

@ -79,7 +79,10 @@ class BotServerTests(BotServerTestCase):
ImportError, ImportError,
"Bot \"nonexistent-bot\" doesn't exists. Please " "Bot \"nonexistent-bot\" doesn't exists. Please "
"make sure you have set up the flaskbotrc file correctly.", "make sure you have set up the flaskbotrc file correctly.",
lambda: self.assert_bot_server_response(available_bots=available_bots, lambda: self.assert_bot_server_response(
available_bots=available_bots,
message=dict(message={'content': "test message"},
bot_email='helloworld-bot@zulip.com'),
bots_config=bots_config)) bots_config=bots_config))
@mock.patch('sys.argv', ['zulip-bot-server', '--config-file', '/foo/bar/baz.conf']) @mock.patch('sys.argv', ['zulip-bot-server', '--config-file', '/foo/bar/baz.conf'])