Skip to content

Commit f9c3baf

Browse files
committed
test(ci): satisfy ty narrowing in graphql pagination fake
Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 24abf11 commit f9c3baf

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tests/scripts/test_bm_bossbot_status.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
22
from pathlib import Path
3-
from typing import Mapping
3+
from typing import Any, Mapping
44

55
import pytest
66
from typer.testing import CliRunner
@@ -255,15 +255,14 @@ def test_count_unresolved_review_threads_pages_through_graphql_results(
255255
]
256256
cursors: list[object] = []
257257

258+
# Signature mirrors bm_bossbot_status._github_request (payload: Mapping[str, Any] | None).
258259
def fake_github_request(
259-
*, method: str, path: str, token: str, payload: Mapping[str, object] | None = None
260+
*, method: str, path: str, token: str, payload: Mapping[str, Any] | None = None
260261
) -> object:
261262
assert method == "POST"
262263
assert path == "/graphql"
263264
assert payload is not None
264-
variables = payload["variables"]
265-
assert isinstance(variables, Mapping)
266-
cursors.append(variables["cursor"])
265+
cursors.append(payload["variables"]["cursor"])
267266
return pages.pop(0)
268267

269268
monkeypatch.setattr(bm_bossbot_status, "_github_request", fake_github_request)

0 commit comments

Comments
 (0)