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:
parent
6a8cb2965c
commit
48f2c2ae36
|
@ -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:
|
||||||
|
|
|
@ -79,8 +79,11 @@ 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(
|
||||||
bots_config=bots_config))
|
available_bots=available_bots,
|
||||||
|
message=dict(message={'content': "test message"},
|
||||||
|
bot_email='helloworld-bot@zulip.com'),
|
||||||
|
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'])
|
||||||
def test_argument_parsing_defaults(self) -> None:
|
def test_argument_parsing_defaults(self) -> None:
|
||||||
|
|
Loading…
Reference in a new issue