mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Raise loudly when RdSAP Summary fetch returns an HTTP error 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
83d92010de
commit
eff4f64426
1 changed files with 14 additions and 0 deletions
|
|
@ -333,3 +333,17 @@ def test_get_rdsap_summary_raises_unauthorized_on_401() -> None:
|
|||
client.session.get = MagicMock(return_value=make_response(status_code=401))
|
||||
with pytest.raises(UnauthorizedError):
|
||||
client.get_rdsap_summary_by_job_id("job-1")
|
||||
|
||||
|
||||
def test_get_rdsap_summary_raises_on_http_error() -> None:
|
||||
# Arrange
|
||||
client = make_client()
|
||||
|
||||
# Act / Assert — a 404/error must raise loudly, not resolve to empty values
|
||||
client.session.get = MagicMock(
|
||||
return_value=make_response(
|
||||
status_code=404, raise_on_status=requests.HTTPError("not found")
|
||||
)
|
||||
)
|
||||
with pytest.raises(requests.HTTPError):
|
||||
client.get_rdsap_summary_by_job_id("job-1")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue