def test_true_true_connect(self, mock_log, mock_msg): """Function: test_true_true_connect Description: Test connecting to RabbitMQ with true/true status. Arguments: """ mock_log.return_value = True mock_msg.return_value = self.msg self.assertFalse( mail_2_rmq.connect_process(self.rmq, mock_log, self.cfg, mock_msg))
def test_non_error_queue(self, mock_log, mock_msg): """Function: test_non_error_queue Description: Test message sent to non-error queue. Arguments: """ mock_log.return_value = True mock_msg.return_value = self.msg self.assertFalse( mail_2_rmq.connect_process(self.rmq, mock_log, self.cfg, mock_msg))
def test_true_publish(self, mock_log, mock_msg): """Function: test_true_publish Description: Test publish returns true. Arguments: """ mock_log.return_value = True mock_msg.return_value = self.msg self.assertFalse( mail_2_rmq.connect_process(self.rmq, mock_log, self.cfg, mock_msg))
def test_empty_email(self, mock_log, mock_msg): """Function: test_empty_email Description: Test with empty email body. Arguments: """ mock_log.return_value = True mock_msg.return_value = "" self.assertFalse( mail_2_rmq.connect_process(self.rmq, mock_log, self.cfg, mock_msg))
def test_true_false_connect(self, mock_log, mock_archive): """Function: test_true_false_connect Description: Test connecting to RabbitMQ with true/false status. Arguments: """ mock_log.return_value = True mock_archive.return_value = True self.rmq.change_channel(False) self.assertFalse( mail_2_rmq.connect_process(self.rmq, mock_log, self.cfg, ""))
def test_file_publish(self, mock_log, mock_msg): """Function: test_file_publish Description: Test with file name passed. Arguments: """ mock_log.return_value = True mock_msg.return_value = self.msg self.assertFalse( mail_2_rmq.connect_process(self.rmq, mock_log, self.cfg, mock_msg, fname=self.fname))