fix(integrations): 上游扫码状态叫 wait,页面认的是 waiting,先对齐再翻
CI / backend (push) Canceled after 0s

This commit is contained in:
Steven
2026-11-05 23:06:57 +08:00
parent 8436c0edbf
commit 8e3dc65cc6
3 changed files with 22 additions and 0 deletions
+11
View File
@@ -324,3 +324,14 @@ async def test_stale_token_marks_channel_expired(
assert channels["items"][0]["status"] == "expired"
assert channels["items"][0]["connected"] is False
assert "重新扫码" in channels["items"][0]["last_error"]
async def test_upstream_wait_status_is_normalized(monkeypatch: pytest.MonkeyPatch) -> None:
"""上游说 "wait",页面只认 waiting——这一层要对齐,否则界面停在"等扫码结果…"。"""
async def fake_post(path: str, body: dict, **kwargs: Any) -> dict: # noqa: ARG001
return {"status": "wait"}
monkeypatch.setattr(wechat_ilink, "_post", fake_post)
result = await wechat_ilink.qrcode_status("qr-x")
assert result.status == "waiting"