def test_default(self, mock_checksum): """Function: test_default Description: Test with default arguments only. Arguments: """ mock_checksum.side_effect = [10, 10] with gen_libs.no_std_out(): self.assertFalse( mysql_rep_cmp.recur_tbl_cmp(self.master, self.slave, "db1", "tbl1", 1))
def test_reached_max(self, mock_checksum): """Function: test_reached_max Description: Test with reaching max checks. Arguments: """ mock_checksum.side_effect = [10, 11, 10, 11] with gen_libs.no_std_out(): self.assertFalse( mysql_rep_cmp.recur_tbl_cmp(self.master, self.slave, "db1", "tbl1", 3))
def test_no_recur(self, mock_checksum): """Function: test_no_recur Description: Test with no recur parameter set. Arguments: """ mock_checksum.side_effect = [10, 10] with gen_libs.no_std_out(): self.assertFalse( mysql_rep_cmp.recur_tbl_cmp(self.master, self.slave, "db1", "tbl1"))
def test_no_recur_email(self, mock_checksum): """Function: test_no_recur_email Description: Test with no recur parameter set with email. Arguments: """ mock_checksum.side_effect = [10, 10] with gen_libs.no_std_out(): self.assertFalse( mysql_rep_cmp.recur_tbl_cmp(self.master, self.slave, "db1", "tbl1", mail=self.mail)) self.assertEqual(self.mail.msg, self.results)
def test_reached_max_mail(self, mock_checksum): """Function: test_reached_max_mail Description: Test with reaching max checks with email. Arguments: """ mock_checksum.side_effect = [10, 11, 10, 11] with gen_libs.no_std_out(): self.assertFalse( mysql_rep_cmp.recur_tbl_cmp(self.master, self.slave, "db1", "tbl1", 3, mail=self.mail)) self.assertEqual(self.mail.msg, self.results2)
def test_check_once_no_std(self, mock_checksum): """Function: test_check_once_no_std Description: Test with checksumming at once with no_std. Arguments: """ mock_checksum.side_effect = [10, 11, 10, 10] self.assertFalse( mysql_rep_cmp.recur_tbl_cmp(self.master, self.slave, "db1", "tbl1", 1, mail=self.mail, no_std=self.no_std)) self.assertEqual(self.mail.msg, self.results)