mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-29 12:35:13 +00:00
fix(remote): map a cut-off answer to a recoverable error and stop trusting an empty optional answer
This commit is contained in:
@@ -116,3 +116,10 @@ def test_local_proxy_is_refused_for_a_server_account_service() -> None:
|
||||
|
||||
with pytest.raises(click.ClickException, match="its own account"):
|
||||
list(svc.search())
|
||||
|
||||
|
||||
def test_malformed_search_results_from_the_server_are_one_remote_error() -> None:
|
||||
svc, client, _ = make_service({"no_proxy": True}, server_accounts={"global": True})
|
||||
client.post = lambda endpoint, data: {"results": [{"title": "no id"}]} # type: ignore[method-assign]
|
||||
with pytest.raises(remote_service.RemoteError, match="malformed search results"):
|
||||
list(svc.search())
|
||||
|
||||
Reference in New Issue
Block a user