mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
UnauthorizedError propagates when both PAS and coordination clients return 401 🟩
This commit is contained in:
parent
5a29866245
commit
dcff529219
1 changed files with 15 additions and 0 deletions
|
|
@ -291,6 +291,21 @@ def test_run_raises_unauthorized_when_pas_401_and_no_factory() -> None:
|
||||||
service.run(make_request())
|
service.run(make_request())
|
||||||
|
|
||||||
|
|
||||||
|
def test_run_raises_unauthorized_when_both_clients_401() -> None:
|
||||||
|
pas_client = MagicMock(spec=PashubClient)
|
||||||
|
pas_client.get_uprn_by_job_id.side_effect = UnauthorizedError()
|
||||||
|
|
||||||
|
coord_client = MagicMock(spec=PashubClient)
|
||||||
|
coord_client.get_uprn_by_job_id.side_effect = UnauthorizedError()
|
||||||
|
|
||||||
|
factory = MagicMock(return_value=coord_client)
|
||||||
|
|
||||||
|
service = make_service(pashub_client=pas_client, coordination_client_factory=factory)
|
||||||
|
|
||||||
|
with pytest.raises(UnauthorizedError):
|
||||||
|
service.run(make_request())
|
||||||
|
|
||||||
|
|
||||||
def test_run_warns_and_continues_when_site_notes_parsing_fails() -> None:
|
def test_run_warns_and_continues_when_site_notes_parsing_fails() -> None:
|
||||||
mock_client = MagicMock(spec=PashubClient)
|
mock_client = MagicMock(spec=PashubClient)
|
||||||
mock_client.get_uprn_by_job_id.return_value = None
|
mock_client.get_uprn_by_job_id.return_value = None
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue