Skip to content

Commit

Permalink
Refine tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ten0s committed Aug 26, 2015
1 parent a4b872f commit 6b3bf18
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ def test_auth_from_address_fail(smtp):
def test_auth_from_address_user_no_email_if_fail(smtp):
msg = MIMEText('from_address test')
msg['From'] = AUTH_FROM_ADDR_USER_NO_EMAIL_IF
msg['To'] = TO
## both subject and to_address auth are valid.
## the test should fail nonetheless because customer is found,
## but doesn't have email interface
msg['To'] = AUTH_TO_ADDR
msg['Subject'] = AUTH_SUBJECT
(code, resp) = sendmail(smtp, msg['From'], TO, msg.as_string())
assert code == 550
assert resp == 'Invalid user account'
Expand All @@ -95,9 +99,12 @@ def test_auth_subject_bad_subject_fail(smtp):
assert resp == 'Invalid user account'

def test_auth_subject_bad_password_fail(smtp):
## to_address auth is valid.
## the test should fail nonetheless because customer is found,
## but the password is wrong
msg = MIMEText('subject test')
msg['From'] = AUTH_FROM_ADDR_BAD
msg['To'] = TO
msg['To'] = AUTH_TO_ADDR
msg['Subject'] = AUTH_SUBJECT_BAD_PASSWORD
(code, resp) = sendmail(smtp, msg['From'], TO, msg.as_string())
assert code == 550
Expand Down

0 comments on commit 6b3bf18

Please sign in to comment.