From b70afc8d9dffcf000f869815b7bbc03d303721c3 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 3 Jul 2026 16:20:41 +0000 Subject: [PATCH] =?UTF-8?q?Abri=20amend=5Fjob=20omits=20the=20surveyor=20r?= =?UTF-8?q?esource=20so=20amendments=20cannot=20clobber=20Abri-side=20reas?= =?UTF-8?q?signments=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- tests/infrastructure/abri/test_abri_client.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/infrastructure/abri/test_abri_client.py b/tests/infrastructure/abri/test_abri_client.py index 87e13b9d1..ed6b4cecf 100644 --- a/tests/infrastructure/abri/test_abri_client.py +++ b/tests/infrastructure/abri/test_abri_client.py @@ -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