Skip to content

Commit

Permalink
improving the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Murray Christopherson committed Jul 13, 2020
1 parent fd468a8 commit 538bfc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions tests/test_quick_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@


class TestQuickEmail(unittest.TestCase):
def run(self, *args, **kwargs):
super().run(*arg, **kwargs)

time.sleep(smtp.SMTP_RATE_LIMIT_SECONDS)


def test_send_email_auth(self):
send_email(smtp.SMTP_HOST, smtp.SMTP_PORT, u'Example <example@example.com>', u'The Subject', send_to=u'Test <test@test.com>',
plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>', username=smtp.SMTP_USERNAME, password=smtp.SMTP_PASSWORD)
time.sleep(smtp.SMTP_RATE_LIMIT_SECONDS)

def test_send_email_starttls_auth(self):
send_email(smtp.SMTP_HOST, smtp.SMTP_PORT, u'Example <example@example.com>', u'The Subject', send_to=u'Test <test@test.com>',
plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>', username=smtp.SMTP_USERNAME, password=smtp.SMTP_PASSWORD, require_starttls=True)
time.sleep(smtp.SMTP_RATE_LIMIT_SECONDS)


if __name__ == u'__main__':
Expand Down
7 changes: 5 additions & 2 deletions tests/test_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@


class TestSender(unittest.TestCase):
def run(self, *args, **kwargs):
super().run(*arg, **kwargs)

time.sleep(smtp.SMTP_RATE_LIMIT_SECONDS)

def test_minimal(self):
msg = builder.build_msg(u'Example <example@example.com>', u'The Subject',
send_to=u'Test <test@test.com>', plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>')
sender.send_msg(msg, smtp.SMTP_HOST, smtp.SMTP_PORT, username=smtp.SMTP_USERNAME,
password=smtp.SMTP_PASSWORD, require_starttls=True)
time.sleep(smtp.SMTP_RATE_LIMIT_SECONDS)

def test_multiple_recipients(self):
msg = builder.build_msg(u'Example <example@example.com>', u'The Subject', send_to=u'Test <test@test.com>', send_cc=[
u'Example <example@example.com>', u'Example2 <example2@example.com>'], send_bcc=u'Example3 <example3@example.com>', plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>')
sender.send_msg(msg, smtp.SMTP_HOST, smtp.SMTP_PORT, username=smtp.SMTP_USERNAME,
password=smtp.SMTP_PASSWORD, require_starttls=True)
time.sleep(smtp.SMTP_RATE_LIMIT_SECONDS)


if __name__ == u'__main__':
Expand Down

0 comments on commit 538bfc9

Please sign in to comment.