Exemple #1
0
    def test_list_fail(self, mock_logs):
        """Function:  test_list_fail

        Description:  Test with process_logs_list function fails.

        Arguments:

        """

        mock_logs.return_value = self.status2, self.binlog_list

        with gen_libs.no_std_out():
            self.assertFalse(
                mysql_log_admin.load_log(self.server, self.args_array,
                                         self.opt_arg_list))
Exemple #2
0
    def test_no_opt_arg_lists(self, mock_logs, mock_inst, mock_cmd, mock_fetch,
                              mock_popen):
        """Function:  test_no_opt_arg_lists

        Description:  Test with empty opt_arg_list list.

        Arguments:

        """

        mock_logs.return_value = self.status, self.binlog_list
        mock_inst.return_value = self.server
        mock_cmd.return_value = self.cmd_list
        mock_fetch.return_value = "Process"
        mock_popen.return_value = self.proc

        self.assertFalse(
            mysql_log_admin.load_log(self.server, self.args_array, []))
Exemple #3
0
    def test_connection_error(self, mock_logs, mock_inst):
        """Function:  test_connection_error

        Description:  Test with connection error.

        Arguments:

        """

        self.server.conn_msg = "Connection error message"

        mock_logs.return_value = self.status, self.binlog_list
        mock_inst.return_value = self.server

        with gen_libs.no_std_out():
            self.assertFalse(
                mysql_log_admin.load_log(self.server, self.args_array,
                                         self.opt_arg_list))