Abri amend_job surfaces OpenHousing rejections with code and message verbatim 🟩

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-03 16:22:11 +00:00
parent e363a1105a
commit e9cb46a58b
2 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<response>
<success>false</success>
<code>RelayError</code>
<message>Job_no 1019905 is invalid. Job not found.</message>
</response>

View file

@ -272,3 +272,24 @@ def test_amend_job_omits_the_resource_parameter_when_no_surveyor_is_provided(
for parameter in ET.fromstring(sent_body).findall(".//Parameters")
]
assert "resource" not in sent_attributes
# --- amend_job: rejection ---
def test_amend_job_returns_rejection_with_openhousing_error_code_and_message_verbatim(
client: AbriClient, mock_session: MagicMock
) -> None:
# Arrange
mock_session.post.return_value.content = _load_fixture(
"abri_relay_amendoptiappt_relayerror_response.xml"
)
# Act
result = client.amend_job(_spec_example_amend_request())
# Assert
assert result == AbriRequestRejected(
code="RelayError",
message="Job_no 1019905 is invalid. Job not found.",
)