Abri log_job treats a malformed relay response as retriable, never as success or rejection 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-03 14:29:08 +00:00
parent 95bb951b60
commit ff34872c24

View file

@ -14,7 +14,7 @@ from domain.abri.models import (
)
from infrastructure.abri.abri_client import AbriClient
from infrastructure.abri.config import AbriConfig
from infrastructure.abri.errors import AbriTransportError
from infrastructure.abri.errors import AbriResponseParseError, AbriTransportError
FIXTURE_DIR = Path(__file__).parents[2] / "abri"
ENDPOINT_URL = "https://relay.example.test/api/DomnaRelay?code=test-function-key"
@ -158,3 +158,17 @@ def test_log_job_raises_transport_error_when_the_relay_is_unreachable(
# Act / Assert
with pytest.raises(AbriTransportError):
client.log_job(_spec_example_request())
# --- log_job: ambiguous responses are retriable, never success or rejection ---
def test_log_job_raises_retriable_parse_error_on_a_malformed_response_body(
client: AbriClient, mock_session: MagicMock
) -> None:
# Arrange
mock_session.post.return_value.content = b"not xml at all <<<"
# Act / Assert
with pytest.raises(AbriResponseParseError):
client.log_job(_spec_example_request())