mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
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:
parent
95bb951b60
commit
ff34872c24
1 changed files with 15 additions and 1 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue