fix(huya): 抽出通用绑定角色查询,修复外部单协作读到旧角色

This commit is contained in:
yml2213
2026-11-09 22:13:07 +08:00
parent b06b622eb3
commit 3a48d9c624
5 changed files with 190 additions and 92 deletions
+14 -8
View File
@@ -1050,14 +1050,20 @@ def test_confirm_bind_uses_latest_har_protocol(monkeypatch):
"outer_act_id": "17096",
}
]
assert all(
call["b_act_id"] == 0
and call["gid"] == 3203
and call["outer_act_id"] == "17096"
and call["is_use_outer_act_id"] == 0
and call["scene"] == "undefined"
for call in client.check_calls
)
# 通用查询会连打两路:外层 gid+outerActId=17096,内层 gid+outerActId=空。
assert len(client.check_calls) == 4 # 绑定前查一次 + 确认后刷新查一次
for call in client.check_calls[0::2]:
assert call["b_act_id"] == 0
assert call["gid"] == 3203
assert call["outer_act_id"] == "17096"
assert call["is_use_outer_act_id"] == 0
assert call["scene"] == "undefined"
for call in client.check_calls[1::2]:
assert call["b_act_id"] == 0
assert call["gid"] == 3203
assert call["outer_act_id"] == ""
assert call["is_use_outer_act_id"] == 0
assert call["scene"] == "undefined"
def test_get_bind_qr_uses_latest_har_protocol(monkeypatch):