fix: 修复 antigravity UserAgent 重构遗留的编译错误和测试不匹配

- oauth.go: GetUserAgent() 缺少闭合大括号导致语法错误
- client_test.go/oauth_test.go: UserAgent 变量已重构为 GetUserAgent(),更新测试引用
- model_rate_limit_test.go: gemini-3-pro-preview 映射目标已更新为 gemini-3.1-pro-high,同步测试
This commit is contained in:
shaw
2026-02-24 14:44:57 +08:00
parent 84bd881e68
commit e435a46db5
4 changed files with 10 additions and 9 deletions

View File

@@ -49,8 +49,8 @@ func TestNewAPIRequestWithURL_普通请求(t *testing.T) {
if auth := req.Header.Get("Authorization"); auth != "Bearer test-token" {
t.Errorf("Authorization 不匹配: got %s", auth)
}
if ua := req.Header.Get("User-Agent"); ua != UserAgent {
t.Errorf("User-Agent 不匹配: got %s, want %s", ua, UserAgent)
if ua := req.Header.Get("User-Agent"); ua != GetUserAgent() {
t.Errorf("User-Agent 不匹配: got %s, want %s", ua, GetUserAgent())
}
}
@@ -1191,7 +1191,7 @@ func TestClient_LoadCodeAssist_Success_RealCall(t *testing.T) {
if ct := r.Header.Get("Content-Type"); ct != "application/json" {
t.Errorf("Content-Type 不匹配: got %s", ct)
}
if ua := r.Header.Get("User-Agent"); ua != UserAgent {
if ua := r.Header.Get("User-Agent"); ua != GetUserAgent() {
t.Errorf("User-Agent 不匹配: got %s", ua)
}
@@ -1380,7 +1380,7 @@ func TestClient_FetchAvailableModels_Success_RealCall(t *testing.T) {
if ct := r.Header.Get("Content-Type"); ct != "application/json" {
t.Errorf("Content-Type 不匹配: got %s", ct)
}
if ua := r.Header.Get("User-Agent"); ua != UserAgent {
if ua := r.Header.Get("User-Agent"); ua != GetUserAgent() {
t.Errorf("User-Agent 不匹配: got %s", ua)
}