mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Abri amend_job raises retriable transport errors when the amendment outcome is unknown 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
096e4ae1f7
commit
05bd22269d
1 changed files with 28 additions and 0 deletions
|
|
@ -320,3 +320,31 @@ def test_amend_job_raises_retriable_parse_error_when_the_amendment_is_unconfirme
|
|||
# Act / Assert
|
||||
with pytest.raises(AbriResponseParseError):
|
||||
client.amend_job(_spec_example_amend_request())
|
||||
|
||||
|
||||
# --- amend_job: transport failures ---
|
||||
|
||||
|
||||
def test_amend_job_raises_transport_error_on_http_error_status(
|
||||
client: AbriClient, mock_session: MagicMock
|
||||
) -> None:
|
||||
# Arrange
|
||||
mock_session.post.return_value.content = b"<html>Server Error</html>"
|
||||
mock_session.post.return_value.raise_for_status.side_effect = requests.HTTPError(
|
||||
"500 Server Error"
|
||||
)
|
||||
|
||||
# Act / Assert
|
||||
with pytest.raises(AbriTransportError):
|
||||
client.amend_job(_spec_example_amend_request())
|
||||
|
||||
|
||||
def test_amend_job_raises_transport_error_when_the_relay_is_unreachable(
|
||||
client: AbriClient, mock_session: MagicMock
|
||||
) -> None:
|
||||
# Arrange
|
||||
mock_session.post.side_effect = requests.ConnectionError("connection refused")
|
||||
|
||||
# Act / Assert
|
||||
with pytest.raises(AbriTransportError):
|
||||
client.amend_job(_spec_example_amend_request())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue