test: 补齐规格纠偏安全场景 (#258)
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user