Added test for /otr start when no key loaded
This commit is contained in:
@@ -539,6 +539,24 @@ void cmd_otr_start_shows_message_when_already_started(void **state)
|
||||
free(help);
|
||||
}
|
||||
|
||||
void cmd_otr_start_shows_message_when_no_key(void **state)
|
||||
{
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
gchar *args[] = { "start", NULL };
|
||||
mock_connection_status(JABBER_CONNECTED);
|
||||
mock_current_win_type(WIN_CHAT);
|
||||
ui_current_win_is_otr_returns(FALSE);
|
||||
otr_key_loaded_returns(FALSE);
|
||||
mock_ui_current_print_formatted_line();
|
||||
|
||||
ui_current_print_formatted_line_expect('!', 0, "You have not generated or loaded a private key, use '/otr gen'");
|
||||
|
||||
gboolean result = cmd_otr(args, *help);
|
||||
assert_true(result);
|
||||
|
||||
free(help);
|
||||
}
|
||||
|
||||
#else
|
||||
void cmd_otr_shows_message_when_otr_unsupported(void **state)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user