def test_run_program(self, mock_server): """Function: test_run_program Description: Test with only default arguments passed. Arguments: """ mock_server.side_effect = [self.master, self.slave] self.assertFalse( mysql_rep_cmp.run_program(self.args_array, self.sys_ign_db))
def test_no_std_out(self, mock_server): """Function: test_no_std_out Description: Test with no standard out suppression selected. Arguments: """ mock_server.side_effect = [self.master, self.slave] self.assertFalse( mysql_rep_cmp.run_program(self.args_array4, self.sys_ign_db))
def test_int_server_id(self, mock_server): """Function: test_int_server_id Description: Test with integer server_id. Arguments: """ mock_server.side_effect = [self.master, self.slave] self.assertFalse( mysql_rep_cmp.run_program(self.args_array, self.sys_ign_db))
def test_conn_success(self, mock_server): """Function: test_conn_success Description: Test with successful connection to master and slave. Arguments: """ mock_server.side_effect = [self.master, self.slave] self.assertFalse( mysql_rep_cmp.run_program(self.args_array, self.sys_ign_db))
def test_email(self, mock_mail, mock_server): """Function: test_email Description: Test with email setup. Arguments: """ mock_mail.return_value = self.mail mock_server.side_effect = [self.master, self.slave] self.assertFalse( mysql_rep_cmp.run_program(self.args_array2, self.sys_ign_db))
def test_email_no_subj_mailx(self, mock_mail, mock_server): """Function: test_email_no_subj_mailx Description: Test with email using mailx and no subject line. Arguments: """ mock_mail.return_value = self.mail mock_server.side_effect = [self.master, self.slave] self.assertFalse( mysql_rep_cmp.run_program(self.args_array3a, self.sys_ign_db))
def test_database_option(self, mock_server): """Function: test_database_option Description: Test with database option in args_array. Arguments: """ mock_server.side_effect = [self.master, self.slave] self.args_array["-B"] = "db1" self.assertFalse( mysql_rep_cmp.run_program(self.args_array, self.sys_ign_db))
def test_str_server_id(self, mock_server): """Function: test_str_server_id Description: Test with string server_id. Arguments: """ self.master.slv_lists = [{"Server_id": "11"}] mock_server.side_effect = [self.master, self.slave] self.assertFalse( mysql_rep_cmp.run_program(self.args_array, self.sys_ign_db))
def test_slave_not_present(self, mock_server): """Function: test_slave_not_present Description: Test with slave not in replic set. Arguments: """ self.slave.server_id = 12 mock_server.side_effect = [self.master, self.slave] with gen_libs.no_std_out(): self.assertFalse( mysql_rep_cmp.run_program(self.args_array, self.sys_ign_db))
def test_master_conn_fail(self, mock_server): """Function: test_master_conn_fail Description: Test with failed connection on master. Arguments: """ self.master.conn_msg = self.err_msg mock_server.side_effect = [self.master, self.slave] with gen_libs.no_std_out(): self.assertFalse( mysql_rep_cmp.run_program(self.args_array, self.sys_ign_db))