fix(projekt-matching): final-review fixes — safe redeploy, poison-mail hardening, plan deviations note
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import email
|
||||
|
||||
import pytest
|
||||
from unittest import mock
|
||||
|
||||
from projektmatch import mailer
|
||||
@@ -43,6 +45,22 @@ def test_move_uses_move_then_fallback():
|
||||
assert conn.expunge.called
|
||||
|
||||
|
||||
def test_fetch_raises_on_no_response():
|
||||
conn = fake_conn()
|
||||
conn.uid.return_value = ("NO", [None])
|
||||
box = mailer.MailBox("u", "p", conn=conn)
|
||||
with pytest.raises(RuntimeError):
|
||||
box.fetch("3")
|
||||
|
||||
|
||||
def test_fetch_raises_on_malformed_ok_response():
|
||||
conn = fake_conn()
|
||||
conn.uid.return_value = ("OK", [None])
|
||||
box = mailer.MailBox("u", "p", conn=conn)
|
||||
with pytest.raises(RuntimeError):
|
||||
box.fetch("3")
|
||||
|
||||
|
||||
def test_send_mail_starttls():
|
||||
with mock.patch("projektmatch.mailer.smtplib.SMTP") as smtp:
|
||||
server = smtp.return_value.__enter__.return_value
|
||||
|
||||
Reference in New Issue
Block a user