Skip to content

Commit

Permalink
Adding stubs to add SSL/Auth tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Murray Christopherson committed Apr 12, 2018
1 parent 22f2296 commit 71d4ccf
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_quick_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,32 @@
from quick_email import send_email
import smtpd_fake

try:
import aiosmtpd
del aiosmtpd

_can_run_ssl_tests = True
_can_run_auth_tests = True
except ImportError:
_can_run_ssl_tests = False
_can_run_auth_tests = False

class TestQuickEmail(unittest.TestCase):
def test_send_email(self):
smtpd_fake.smtp_server_thread()
send_email(u'localhost', smtpd_fake.SMTP_PORT, u'Example <example@example.com>', u'The Subject', send_to=u'Test <test@test.com>', send_cc=None, send_bcc=None, plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>', attachment_list=None, inline_attachment_dict=None)

@unittest.skipUnless(_can_run_ssl_tests, 'SSL tests unsupported')
def test_send_email_ssl(self):
pass

@unittest.skipUnless(_can_run_auth_tests, 'Auth tests unsupported')
def test_send_email_auth(self):
pass

@unittest.skipUnless(_can_run_ssl_tests and _can_run_auth_tests, 'SSL or Auth tests unsupported')
def test_send_email_ssl_auth(self):
pass

if __name__ == u'__main__':
unittest.main()

0 comments on commit 71d4ccf

Please sign in to comment.