Commit 59b5f728 authored by Hamaker, Alec's avatar Hamaker, Alec
Browse files

Uncommented email tests.

parent 5278cdac
Loading
Loading
Loading
Loading
+29 −29
Original line number Diff line number Diff line
@@ -268,35 +268,35 @@ class LogzTestCase(unittest.TestCase):
        plm.write_log_collection_to_database()


# class MailTestCase(unittest.TestCase):
#     """MailTestCase."""
# 
#     def test_send_email(self):
#         """Test to make sure that then send_mail function can actually send
#         mail"""
#         send_email("TEST SUBJECT", "THIS IS A TEST MESSAGE")
# 
#     def test_send_email_attachment(self):
#         """Test to make sure that we can send attachments.."""
#         ATTACHMENT_PATHS = ["/test/test_attachments/test_attachment.txt",
#                             "/test/test_attachments/test_attachment2.txt"]
#         ATTACHMENT_PATHS_W_BAD_FILE = [
#             "/test/test_attachments/test_attachment.txt",
#             "/this/is/not/a/real/file/path.txt"]
#         send_email(
#             "TEST SUBJECT WITH ATTACHMENT", "THIS IS A TEST MESSAGE",
#             files=[ATTACHMENT_PATHS[0]]
#         )
#         send_email("TEST SUBJECT MULTI-ATTACHMENTS", "TEST MESSAGE",
#                    files=ATTACHMENT_PATHS)
#         send_email("TEST SUBJECT WITH BAD PATH", "TEST MESSAGE",
#                    files=ATTACHMENT_PATHS_W_BAD_FILE)
#         send_email("TEST SUBJECT WITH STRING FILE PATH", "TEST MESSAGE",
#                    files=ATTACHMENT_PATHS[0])
#         send_email("TESTING RECIPIENT FIELD", "TEST RECIPENT FIELD", 
#                     recipients='huihuijk@ornl.gov')
#         #send_email("TESTING RECIPIENT FIELD MULTI ADDRESS", "TEST RECIPENT FIELD", 
#         #            recipients='huihuijk@ornl.gov, jonathanhuihui@yahoo.com, jonathankhuihui@gmail.com')
class MailTestCase(unittest.TestCase):
    """MailTestCase."""

    def test_send_email(self):
        """Test to make sure that then send_mail function can actually send
        mail"""
        send_email("TEST SUBJECT", "THIS IS A TEST MESSAGE")

    def test_send_email_attachment(self):
        """Test to make sure that we can send attachments.."""
        ATTACHMENT_PATHS = ["/test/test_attachments/test_attachment.txt",
                            "/test/test_attachments/test_attachment2.txt"]
        ATTACHMENT_PATHS_W_BAD_FILE = [
            "/test/test_attachments/test_attachment.txt",
            "/this/is/not/a/real/file/path.txt"]
        send_email(
            "TEST SUBJECT WITH ATTACHMENT", "THIS IS A TEST MESSAGE",
            files=[ATTACHMENT_PATHS[0]]
        )
        send_email("TEST SUBJECT MULTI-ATTACHMENTS", "TEST MESSAGE",
                   files=ATTACHMENT_PATHS)
        send_email("TEST SUBJECT WITH BAD PATH", "TEST MESSAGE",
                   files=ATTACHMENT_PATHS_W_BAD_FILE)
        send_email("TEST SUBJECT WITH STRING FILE PATH", "TEST MESSAGE",
                   files=ATTACHMENT_PATHS[0])
        send_email("TESTING RECIPIENT FIELD", "TEST RECIPENT FIELD", 
                    recipients='huihuijk@ornl.gov')
        #send_email("TESTING RECIPIENT FIELD MULTI ADDRESS", "TEST RECIPENT FIELD", 
        #            recipients='huihuijk@ornl.gov, jonathanhuihui@yahoo.com, jonathankhuihui@gmail.com')


class PandasTestCase(unittest.TestCase):