def test_good(self): """Function: test_good Description: Test with good status return on all checks. Arguments: """ self.assertEqual( mongo_rep_admin.node_chk(self.server, self.args_array), self.status)
def test_health_fail(self): """Function: test_health_fail Description: Test with health failure check. Arguments: """ self.server.status["members"][0]["health"] = 0.0 self.assertEqual( mongo_rep_admin.node_chk(self.server, self.args_array), self.status)
def test_message_fail(self): """Function: test_message_fail Description: Test with message failure check. Arguments: """ self.server.status["members"][0]["infoMessage"] = "Error Message Here" self.assertEqual( mongo_rep_admin.node_chk(self.server, self.args_array), self.status)
def test_suppression_fail(self): """Function: test_suppression_fail Description: Test with standard suppression and failure. Arguments: """ self.server.status["members"][0]["health"] = 0.0 self.assertEqual( mongo_rep_admin.node_chk(self.server, self.args_array2), self.status)
def test_flatten_fail(self): """Function: test_flatten_fail Description: Test with flatten JSON and failure. Arguments: """ self.server.status["members"][0]["health"] = 0.0 self.assertEqual( mongo_rep_admin.node_chk(self.server, self.args_array3), self.status)
def test_mail_fail(self): """Function: test_mail_fail Description: Test with mail and failure. Arguments: """ self.server.status["members"][0]["state"] = 8 self.assertEqual( mongo_rep_admin.node_chk(self.server, self.args_array2, mail=self.mail), self.status)
def test_mail_no_subj(self): """Function: test_mail_no_subj Description: Test with mail and no subject set. Arguments: """ self.server.status["members"][0]["state"] = 8 self.mail.subj = None self.assertEqual( mongo_rep_admin.node_chk(self.server, self.args_array2, mail=self.mail), self.status)