Skip to content

Commit

Permalink
fix notify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault committed Oct 6, 2023
1 parent c2c794b commit e0b9efe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def test_encrypt_email_random():
token3 = encrypt_email(email, settings)
assert token1 != token2 != token3

# although encrypted are all different, they should all decrypt back to the original!
email1 = decrypt_email(token1, settings)
email2 = decrypt_email(token2, settings)
email3 = decrypt_email(token3, settings)
assert email1 == email2 == email3 == email


@pytest.mark.parametrize("email_func", [encrypt_email, decrypt_email])
def test_encrypt_decrypt_email_raise(email_func):
Expand Down Expand Up @@ -69,7 +75,7 @@ def test_notify_job_complete():

test_job.status = Status.SUCCEEDED
notify_job_complete(test_job, notify_email, settings)
mock_smtp.assert_called_with("xyz.test.com", 12345)
mock_smtp.assert_called_with("xyz.test.com", 12345, timeout=1)
assert mock_smtp.return_value.sendmail.call_args[0][0] == "[email protected]"
assert mock_smtp.return_value.sendmail.call_args[0][1] == notify_email
message_encoded = mock_smtp.return_value.sendmail.call_args[0][2]
Expand Down

0 comments on commit e0b9efe

Please sign in to comment.