test: satisfy pyright strict annotations on the new supervise RPC tests
tracker-policy-pr / check-pr (pull_request) Successful in 12s
test / integration-docker (pull_request) Successful in 19s
test / unit (pull_request) Failing after 50s
lint / lint (push) Successful in 2m51s
test / integration-firecracker (pull_request) Successful in 3m34s
test / coverage (pull_request) Has been skipped
test / publish-infra (pull_request) Has been skipped
tracker-policy-pr / check-pr (pull_request) Successful in 12s
test / integration-docker (pull_request) Successful in 19s
test / unit (pull_request) Failing after 50s
lint / lint (push) Successful in 2m51s
test / integration-firecracker (pull_request) Successful in 3m34s
test / coverage (pull_request) Has been skipped
test / publish-infra (pull_request) Has been skipped
Add parameter/return annotations to the fake resolver's propose_supervise / poll_supervise, annotate the test helpers and the shared _ARGS payload, and narrow the None-able poll result — no behavior change. pylint 9.83, pyright clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -279,14 +279,15 @@ class _SuperviseRpcFake:
|
||||
propose_error: bool = False
|
||||
|
||||
@property
|
||||
def propose_calls(self) -> list:
|
||||
def propose_calls(self) -> list[dict[str, str]]:
|
||||
if not hasattr(self, "_propose_calls"):
|
||||
self._propose_calls: list = []
|
||||
self._propose_calls: list[dict[str, str]] = []
|
||||
return self._propose_calls
|
||||
|
||||
def propose_supervise(
|
||||
self, source_ip, identity_token, *, tool, proposed_file, justification,
|
||||
):
|
||||
self, source_ip: str, identity_token: str, *,
|
||||
tool: str, proposed_file: str, justification: str,
|
||||
) -> str:
|
||||
del proposed_file, justification
|
||||
self.propose_calls.append(
|
||||
{"source_ip": source_ip, "identity_token": identity_token, "tool": tool}
|
||||
@@ -295,7 +296,9 @@ class _SuperviseRpcFake:
|
||||
raise PolicyResolveError("orchestrator down")
|
||||
return "prop-1"
|
||||
|
||||
def poll_supervise(self, source_ip, identity_token, proposal_id):
|
||||
def poll_supervise(
|
||||
self, source_ip: str, identity_token: str, proposal_id: str,
|
||||
) -> dict[str, object]:
|
||||
del source_ip, identity_token, proposal_id
|
||||
if self.supervise_status is None:
|
||||
return {"status": "pending"}
|
||||
|
||||
Reference in New Issue
Block a user