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:
tlg
2026-07-09 17:15:39 +02:00
parent 1863ce087c
commit 9ca7767208
6 changed files with 154 additions and 73 deletions

View File

@@ -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