def test_o_option(self, mock_inst, mock_cmd, mock_list): """Function: test_o_option Description: Test with -o option. Arguments: """ mock_inst.return_value = self.server mock_cmd.return_value = self.dump_cmd mock_list.return_value = self.db_list self.assertFalse( mysql_db_dump.run_program(self.args_array2, self.opt_arg_list, self.opt_dump_list))
def test_run_program(self, mock_inst, mock_cmd, mock_list): """Function: test_run_program Description: Test run_program with default settings. Arguments: """ mock_inst.return_value = self.server mock_cmd.return_value = self.dump_cmd mock_list.return_value = self.db_list self.assertFalse( mysql_db_dump.run_program(self.args_array, self.opt_arg_list, self.opt_dump_list))
def test_email(self, mock_inst, mock_cmd, mock_list): """Function: test_email Description: Test with email configured. Arguments: """ mock_inst.return_value = self.server mock_cmd.return_value = self.dump_cmd mock_list.return_value = self.db_list self.assertFalse( mysql_db_dump.run_program(self.args_array7, self.opt_arg_list, self.opt_dump_list))
def test_email_subj(self, mock_inst, mock_cmd, mock_list): """Function: test_email_subj Description: Test with subject line passed. Arguments: """ mock_inst.return_value = self.server mock_cmd.return_value = self.dump_cmd mock_list.return_value = self.db_list self.assertFalse( mysql_db_dump.run_program(self.args_array8, self.opt_arg_list, self.opt_dump_list))
def test_multiple_options(self, mock_inst, mock_cmd, mock_list): """Function: test_multiple_options Description: Test with multiple options passed. Arguments: """ mock_inst.return_value = self.server mock_cmd.return_value = self.dump_cmd mock_list.return_value = self.db_list self.assertFalse( mysql_db_dump.run_program(self.args_array9, self.opt_arg_list, self.opt_dump_list))
def test_connect_success(self, mock_inst, mock_cmd, mock_list): """Function: test_connect_success Description: Test with successful connection. Arguments: """ mock_inst.return_value = self.server mock_cmd.return_value = self.dump_cmd mock_list.return_value = self.db_list self.assertFalse( mysql_db_dump.run_program(self.args_array, self.opt_arg_list, self.opt_dump_list))
def test_connect_failure(self, mock_inst): """Function: test_connect_failure Description: Test with failed connection. Arguments: """ self.server.conn_msg = "Error connection message" mock_inst.return_value = self.server with gen_libs.no_std_out(): self.assertFalse( mysql_db_dump.run_program(self.args_array, self.opt_arg_list, self.opt_dump_list))
def test_r_option2(self, mock_inst, mock_cmd, mock_list): """Function: test_r_option2 Description: Test with -r option and GTID set to False. Arguments: """ self.server.gtid_mode = False mock_inst.return_value = self.server mock_cmd.return_value = self.dump_cmd mock_list.return_value = self.db_list self.assertFalse( mysql_db_dump.run_program(self.args_array5, self.opt_arg_list, self.opt_dump_list))
def test_r_option_miss(self, mock_inst, mock_cmd, mock_list): """Function: test_r_option_miss Description: Test with -r option value not in command list. Arguments: """ self.server.gtid_mode = False mock_inst.return_value = self.server mock_cmd.return_value = self.dump_cmd2 mock_list.return_value = self.db_list self.assertFalse( mysql_db_dump.run_program(self.args_array5, self.opt_arg_list, self.opt_dump_list))