mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Surface both canceljob failure shapes as verbatim rejections 🟥
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
03f0f4d490
commit
a384b87d8f
3 changed files with 54 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" ?>
|
||||
<Root>
|
||||
<CancelJobs />
|
||||
<ErrorDetails code="RelayError" message="Job_no 1019905 is invalid. Job not found." />
|
||||
</Root>
|
||||
6
tests/abri/abri_relay_canceljob_relayerror_response.xml
Normal file
6
tests/abri/abri_relay_canceljob_relayerror_response.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<response>
|
||||
<success>false</success>
|
||||
<code>RelayError</code>
|
||||
<message>Job_no 1019905 is invalid. Job not found.</message>
|
||||
</response>
|
||||
|
|
@ -129,6 +129,49 @@ def test_log_job_sends_the_recorded_logjob_envelope_to_the_relay_endpoint(
|
|||
)
|
||||
|
||||
|
||||
# --- abandon_job: rejection (canceljob's own error-details shape) ---
|
||||
|
||||
|
||||
def test_abandon_job_returns_rejection_from_the_canceljob_error_details_document(
|
||||
client: AbriClient, mock_session: MagicMock
|
||||
) -> None:
|
||||
# Arrange: canceljob signals failure as an empty cancellation collection
|
||||
# carrying an ErrorDetails element, not the shared failure envelope.
|
||||
mock_session.post.return_value.content = _load_fixture(
|
||||
"abri_relay_canceljob_errordetails_response.xml"
|
||||
)
|
||||
|
||||
# Act
|
||||
result = client.abandon_job(_spec_example_abandon_request())
|
||||
|
||||
# Assert
|
||||
assert result == AbriRequestRejected(
|
||||
code="RelayError",
|
||||
message="Job_no 1019905 is invalid. Job not found.",
|
||||
)
|
||||
|
||||
|
||||
# --- abandon_job: rejection (the shared failure envelope) ---
|
||||
|
||||
|
||||
def test_abandon_job_returns_rejection_from_the_shared_failure_envelope(
|
||||
client: AbriClient, mock_session: MagicMock
|
||||
) -> None:
|
||||
# Arrange
|
||||
mock_session.post.return_value.content = _load_fixture(
|
||||
"abri_relay_canceljob_relayerror_response.xml"
|
||||
)
|
||||
|
||||
# Act
|
||||
result = client.abandon_job(_spec_example_abandon_request())
|
||||
|
||||
# Assert
|
||||
assert result == AbriRequestRejected(
|
||||
code="RelayError",
|
||||
message="Job_no 1019905 is invalid. Job not found.",
|
||||
)
|
||||
|
||||
|
||||
# --- log_job: rejection ---
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue