mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
An OpenHousing rejection is surfaced verbatim with nothing recorded 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
96f86aacac
commit
ddfbbd0052
1 changed files with 26 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ from unittest.mock import MagicMock, patch
|
|||
import pytest
|
||||
from hubspot.crm.deals import SimplePublicObjectInput # type: ignore[reportMissingTypeStubs]
|
||||
|
||||
from domain.abri.models import PlaceRef
|
||||
from domain.abri.models import AbriRequestRejected, PlaceRef
|
||||
from infrastructure.abri.abri_client import AbriClient
|
||||
from infrastructure.abri.config import AbriConfig
|
||||
from infrastructure.hubspot.deal_properties_client import HubspotDealPropertiesClient
|
||||
|
|
@ -149,3 +149,28 @@ def test_run_writes_the_job_no_to_the_hubspot_deal_and_then_the_database(
|
|||
),
|
||||
)
|
||||
assert deal_database.recorded_job_nos == [(DEAL_ID, "AD0226519")]
|
||||
|
||||
|
||||
# --- rejection passthrough: OpenHousing's actual reason, nothing recorded ---
|
||||
|
||||
|
||||
def test_run_returns_the_openhousing_rejection_verbatim_and_records_nothing(
|
||||
orchestrator: AbriLogJobOrchestrator,
|
||||
mock_session: MagicMock,
|
||||
sdk_client: MagicMock,
|
||||
deal_database: FakeDealDatabase,
|
||||
) -> None:
|
||||
# Arrange
|
||||
mock_session.post.return_value.content = _load_fixture(
|
||||
"abri_relay_logjob_relayerror_response.xml"
|
||||
)
|
||||
|
||||
# Act
|
||||
result = orchestrator.run(BOOKING)
|
||||
|
||||
# Assert
|
||||
assert isinstance(result, AbriRequestRejected)
|
||||
assert result.code == "RelayError"
|
||||
assert result.message.startswith("No property was found with UPRN/place_ref")
|
||||
assert sdk_client.mock_calls == []
|
||||
assert deal_database.recorded_job_nos == []
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue