test: 补齐规格纠偏安全场景 (#258)

This commit is contained in:
chengma
2026-08-17 18:37:39 +08:00
parent be900b2411
commit 29cf66ce96
4 changed files with 138 additions and 11 deletions
@@ -220,6 +220,18 @@ func applyAPISpecContractMutation(mutation string, taskID *string, request map[s
case "attempt_id_too_long":
request["attempt_id"] = strings.Repeat("a", 192)
*key = apiSpecIdempotencyKey(*taskID, request)
case "candidate_count_101":
candidates := make([]any, 0, 101)
for index := 1; index <= 101; index++ {
value := "测试尺码" + strconv.Itoa(index)
candidates = append(candidates, map[string]any{
"candidate_id": "c" + strconv.Itoa(index),
"raw_text": value,
"options": map[string]any{"color": "测试黑", "size": value},
})
}
request["candidates"] = candidates
apiSpecRefreshHashes(*taskID, request, key)
case "body_too_large":
request["future_padding"] = strings.Repeat("x", 64<<10)
case "task_not_found":