test: 补充拒绝邀请接口的测试覆盖
This commit is contained in:
@@ -801,6 +801,36 @@ def phase7_shop(s_owner: Session, s_invited_player: Session, owner_user_id, invi
|
||||
body,
|
||||
)
|
||||
|
||||
# Reject invitation flow: re-invite the removed player, then reject
|
||||
code, body, _ = s_owner.post(
|
||||
f"{GATEWAY}/api/v1/shops/{shop_id}/invitations",
|
||||
json_body={"playerId": invited_player_id},
|
||||
headers=csrf,
|
||||
)
|
||||
report(f"POST /shops/{shop_id}/invitations (re-invite)", code, body)
|
||||
|
||||
code, body, _ = s_owner.get(
|
||||
f"{GATEWAY}/api/v1/shops/{shop_id}/invitations",
|
||||
)
|
||||
reinvite_id = 0
|
||||
for item in pick_items(body):
|
||||
if (
|
||||
as_int(item.get("playerId")) == invited_player_id
|
||||
and item.get("status") == "pending"
|
||||
):
|
||||
reinvite_id = as_int(item.get("id"))
|
||||
break
|
||||
if reinvite_id:
|
||||
code, body, _ = s_invited_player.delete(
|
||||
f"{GATEWAY}/api/v1/shops/invitations/{reinvite_id}",
|
||||
headers=s_invited_player.csrf_headers(),
|
||||
)
|
||||
report(
|
||||
f"DELETE /shops/invitations/{reinvite_id} (reject)",
|
||||
code,
|
||||
body,
|
||||
)
|
||||
|
||||
code, body, _ = s_owner.get(f"{GATEWAY}/api/v1/shops/mine")
|
||||
report("GET /shops/mine", code, body)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user