mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-19 16:17:56 +00:00
test(responses): 模型改写转发测试夹具补齐上游 created_at
网关现会为缺 created_at 的 Response 对象补齐该字段(#8118),该测试以 "输出包含上游原始字节"断言模型改写,夹具缺 created_at 时输出多出补齐字段 而失配。夹具改为真实上游必带 created_at 的形态,测试意图(仅改写 model)不变。
This commit is contained in:
@@ -56,7 +56,7 @@ func TestMappedResponseModelForwarding(t *testing.T) {
|
||||
contentType := "application/json"
|
||||
body := payload
|
||||
if kind == "responses" {
|
||||
payload = `{"type":"response.completed","response":{"id":"resp_1","model":"` + returned + `","output":[],"usage":{"input_tokens":1,"output_tokens":1}}}`
|
||||
payload = `{"type":"response.completed","response":{"id":"resp_1","created_at":1700000000,"model":"` + returned + `","output":[],"usage":{"input_tokens":1,"output_tokens":1}}}`
|
||||
want = strings.Replace(payload, `"model":"`+returned+`"`, `"model":"`+model+`"`, 1)
|
||||
}
|
||||
if kind != "json" {
|
||||
|
||||
Reference in New Issue
Block a user