fix(remote): map a cut-off answer to a recoverable error and stop trusting an empty optional answer

This commit is contained in:
imSp4rky
2026-11-28 21:03:54 -07:00
parent 74fa29b6f1
commit f5c8858e6e
12 changed files with 279 additions and 76 deletions
+7
View File
@@ -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())