修复(履约绑定): 修复候选快照丢失与全链路绑定校验一致性
This commit is contained in:
@@ -1278,3 +1278,67 @@ def test_livelink_mini_qrcode_uses_har_query_and_headers(monkeypatch):
|
||||
assert calls[0]["headers"]["Gap-Act-Id"] == "16046"
|
||||
assert calls[0]["headers"]["Gap-Plat-Id"] == "douyu"
|
||||
assert calls[0]["headers"]["Origin"] == "https://livelink.qq.com"
|
||||
|
||||
|
||||
def test_pending_binding_role_hydrates_stripped_action_candidate_without_baseline():
|
||||
"""历史任务 bind_candidates 缺少 need_bind_act 时,应从 bind_info / decisions 补全。"""
|
||||
result = {
|
||||
"act_alias": ACT_ALIAS,
|
||||
"action_act_aliases": [ACT_ALIAS],
|
||||
"baseline_role_name": "",
|
||||
"baseline_is_bound_act": False,
|
||||
"before_bind_info": {},
|
||||
"expected_role_name": "欧美真心",
|
||||
"expected_role_required": True,
|
||||
"role_name": "欧美真心",
|
||||
"bind_ready_for_confirm": True,
|
||||
"bind_confirmed": False,
|
||||
"bind_info": {
|
||||
"act_alias": ACT_ALIAS,
|
||||
"role_name": "欧美真心",
|
||||
"area_name": "手Q",
|
||||
"plat_name": "苹果(iOS)",
|
||||
"is_bound_act": False,
|
||||
"is_bound_role": True,
|
||||
"need_bind_act": True,
|
||||
"need_bind_role": True,
|
||||
},
|
||||
"bind_candidates": [
|
||||
{
|
||||
"act_alias": LEGACY_ALIAS,
|
||||
"role_name": "欧美真心",
|
||||
"is_bound_act": False,
|
||||
},
|
||||
{
|
||||
"act_alias": ACT_ALIAS,
|
||||
"role_name": "欧美真心",
|
||||
"is_bound_act": False,
|
||||
},
|
||||
],
|
||||
"bind_candidate_decisions": [
|
||||
{
|
||||
"alias": ACT_ALIAS,
|
||||
"role_name": "欧美真心",
|
||||
"is_bound_act": False,
|
||||
"is_bound_role": True,
|
||||
"need_bind_act": True,
|
||||
"need_bind_role": True,
|
||||
"actionable_alias": True,
|
||||
"confirmable": True,
|
||||
"reason": "existing_actionable_pending",
|
||||
},
|
||||
{
|
||||
"alias": LEGACY_ALIAS,
|
||||
"role_name": "欧美真心",
|
||||
"is_bound_act": False,
|
||||
"is_bound_role": True,
|
||||
"need_bind_act": False,
|
||||
"need_bind_role": True,
|
||||
"actionable_alias": False,
|
||||
"confirmable": False,
|
||||
"reason": "pending_without_baseline",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
assert pending_binding_role_from_result(result) == "欧美真心"
|
||||
|
||||
Reference in New Issue
Block a user