Abri amend_job omits the surveyor resource so amendments cannot clobber Abri-side reassignments 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-03 16:20:41 +00:00
parent 7bdba469fb
commit b70afc8d9d

View file

@ -252,3 +252,23 @@ def test_amend_job_sends_the_recorded_amendoptiappt_envelope_to_the_relay_endpoi
assert ET.canonicalize(xml_data=sent_body, strip_text=True) == ET.canonicalize(
xml_data=expected_body, strip_text=True
)
def test_amend_job_omits_the_resource_parameter_when_no_surveyor_is_provided(
client: AbriClient, mock_session: MagicMock
) -> None:
# Arrange
mock_session.post.return_value.content = _load_fixture(
"abri_relay_amendoptiappt_success_response.xml"
)
# Act
client.amend_job(_spec_example_amend_request())
# Assert
sent_body: bytes = mock_session.post.call_args.kwargs["data"]
sent_attributes = [
parameter.get("attribute")
for parameter in ET.fromstring(sent_body).findall(".//Parameters")
]
assert "resource" not in sent_attributes