Raise UnauthorizedError when RdSAP Summary fetch returns 401 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-14 13:41:27 +00:00
parent af6c461c93
commit b596f32af1

View file

@ -323,3 +323,13 @@ def test_get_rdsap_summary_maps_pre_performance_fields() -> None:
pre_current_co2_emissions=1.70,
pre_current_energy_consumption=117.00,
)
def test_get_rdsap_summary_raises_unauthorized_on_401() -> None:
# Arrange
client = make_client()
# Act / Assert
client.session.get = MagicMock(return_value=make_response(status_code=401))
with pytest.raises(UnauthorizedError):
client.get_rdsap_summary_by_job_id("job-1")