The deal database gateway reads back a deal's recorded job_no 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-07 09:54:56 +00:00
parent 28c7e44c95
commit 2b29a2412b

View file

@ -46,3 +46,41 @@ def test_record_job_no_for_an_unknown_deal_raises(session: Session) -> None:
# Act / Assert
with pytest.raises(ValueError):
gateway.record_job_no(deal_id="0000000000", job_no="AD0226519")
def test_job_no_for_deal_returns_the_recorded_job_no(session: Session) -> None:
# Arrange
_insert_deal(session, DEAL_ID)
gateway = DealDatabasePostgresGateway(session=session)
gateway.record_job_no(deal_id=DEAL_ID, job_no="AD0226519")
# Act
job_no = gateway.job_no_for_deal(DEAL_ID)
# Assert
assert job_no == "AD0226519"
def test_job_no_for_deal_returns_none_before_any_job_is_recorded(
session: Session,
) -> None:
# Arrange
_insert_deal(session, DEAL_ID)
gateway = DealDatabasePostgresGateway(session=session)
# Act
job_no = gateway.job_no_for_deal(DEAL_ID)
# Assert
assert job_no is None
def test_job_no_for_deal_returns_none_for_an_unknown_deal(session: Session) -> None:
# Arrange
gateway = DealDatabasePostgresGateway(session=session)
# Act
job_no = gateway.job_no_for_deal("0000000000")
# Assert
assert job_no is None