mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
PAS raises UnauthorizedError when 401 received with no coordination factory configured 🟩
This commit is contained in:
parent
0c1ecabf2f
commit
5a29866245
1 changed files with 11 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import pytest
|
||||
from typing import Callable, Optional
|
||||
from unittest.mock import MagicMock, call, patch
|
||||
|
||||
|
|
@ -280,6 +281,16 @@ def test_run_uses_coordination_client_when_pas_401_on_file_listing() -> None:
|
|||
pas_client.get_uprn_by_job_id.assert_not_called()
|
||||
|
||||
|
||||
def test_run_raises_unauthorized_when_pas_401_and_no_factory() -> None:
|
||||
pas_client = MagicMock(spec=PashubClient)
|
||||
pas_client.get_uprn_by_job_id.side_effect = UnauthorizedError()
|
||||
|
||||
service = make_service(pashub_client=pas_client)
|
||||
|
||||
with pytest.raises(UnauthorizedError):
|
||||
service.run(make_request())
|
||||
|
||||
|
||||
def test_run_warns_and_continues_when_site_notes_parsing_fails() -> None:
|
||||
mock_client = MagicMock(spec=PashubClient)
|
||||
mock_client.get_uprn_by_job_id.return_value = None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue