mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Abri amend_job treats an unconfirmed amendment response as retriable 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
e9cb46a58b
commit
65ec38012b
1 changed files with 27 additions and 0 deletions
|
|
@ -293,3 +293,30 @@ def test_amend_job_returns_rejection_with_openhousing_error_code_and_message_ver
|
|||
code="RelayError",
|
||||
message="Job_no 1019905 is invalid. Job not found.",
|
||||
)
|
||||
|
||||
|
||||
# --- amend_job: ambiguous responses are retriable, never success or rejection ---
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"body",
|
||||
[
|
||||
b'<Root><AmendOptiAppt appointment_date="24/06/2026"'
|
||||
b' appointment_time="PM" job_no="AC0439951" success="N" /></Root>',
|
||||
b'<Root><AmendOptiAppt appointment_date="24/06/2026"'
|
||||
b' appointment_time="PM" job_no="AC0439951" /></Root>',
|
||||
b'<Root><AmendOptiAppt appointment_date="24/06/2026"'
|
||||
b' appointment_time="PM" success="Y" /></Root>',
|
||||
b"<Root></Root>",
|
||||
b"<unexpected />",
|
||||
],
|
||||
)
|
||||
def test_amend_job_raises_retriable_parse_error_when_the_amendment_is_unconfirmed(
|
||||
client: AbriClient, mock_session: MagicMock, body: bytes
|
||||
) -> None:
|
||||
# Arrange
|
||||
mock_session.post.return_value.content = body
|
||||
|
||||
# Act / Assert
|
||||
with pytest.raises(AbriResponseParseError):
|
||||
client.amend_job(_spec_example_amend_request())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue