From e0b9efe6541e31f3780d9733f91d6d3f2d077141 Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Fri, 6 Oct 2023 13:45:29 -0400 Subject: [PATCH] fix notify tests --- tests/test_notify.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_notify.py b/tests/test_notify.py index c1062395f..5f029d826 100644 --- a/tests/test_notify.py +++ b/tests/test_notify.py @@ -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): @@ -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] == "test-weaver@email.com" assert mock_smtp.return_value.sendmail.call_args[0][1] == notify_email message_encoded = mock_smtp.return_value.sendmail.call_args[0][2]