重构(斗鱼绑定): 统一角色候选判定与精英宝典查询

This commit is contained in:
yml
2026-11-26 09:14:38 +08:00
parent 244b556800
commit 91e4f5d33a
7 changed files with 470 additions and 175 deletions
+4 -3
View File
@@ -57,8 +57,8 @@ def _bind(
}
def test_role_resolver_does_not_report_legacy_history_as_pending():
"""cjm 可能返回同斗鱼账号历史绑过的另一个游戏角色,不能盖过当前活动角色。"""
def test_role_resolver_keeps_legacy_candidate_alongside_current_bound():
"""查询必须同时保留当前绑定和 cjm 最新候选,不能把候选直接丢掉。"""
client = RoleClient(
{
"current-alias": _bind("当前角色", bound_act=True, bound_role=True),
@@ -71,7 +71,8 @@ def test_role_resolver_does_not_report_legacy_history_as_pending():
assert result["status"] == ROLE_BOUND
assert result["role_name"] == "当前角色"
assert result["source_alias"] == "current-alias"
assert result["pending_role_name"] == ""
assert result["pending_role_name"] == "历史其他账号角色"
assert result["pending_source_alias"] == "cjm"
assert client.calls == ["current-alias", "cjm"]