fix(api): hide campaign operational internals
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from datetime import UTC, datetime
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
|
||||
from govoplan_campaign.backend.reports.campaigns import _job_evidence_row, _latest_by_job_id
|
||||
|
||||
@@ -89,6 +90,8 @@ def test_job_evidence_row_contains_transport_and_message_evidence() -> None:
|
||||
assert row["latest_smtp_response"] == "2.0.0 queued"
|
||||
assert row["latest_imap_status"] == "appended"
|
||||
assert row["latest_imap_folder"] == "Sent"
|
||||
assert "eml_storage_key" not in row
|
||||
assert "eml_local_path" not in row
|
||||
|
||||
|
||||
def test_latest_by_job_id_keeps_highest_attempt_number() -> None:
|
||||
@@ -102,3 +105,15 @@ def test_latest_by_job_id_keeps_highest_attempt_number() -> None:
|
||||
|
||||
assert latest["job-1"].attempt_number == 3
|
||||
assert latest["job-2"].attempt_number == 2
|
||||
|
||||
|
||||
class CampaignReportProjectionTests(unittest.TestCase):
|
||||
def test_evidence_projection(self) -> None:
|
||||
test_job_evidence_row_contains_transport_and_message_evidence()
|
||||
|
||||
def test_latest_attempt_projection(self) -> None:
|
||||
test_latest_by_job_id_keeps_highest_attempt_number()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user