fix: resolve typecheck errors in loop_test.go and dingtalk_test.go (#2122)
- loop_test.go: replace undefined WithSecurity/SecurityConfig/ModelSecurityEntry with direct APIKeys field using SimpleSecureStrings() - dingtalk_test.go: use ClientSecret.String() and ClientSecret.Set() instead of non-existent ClientSecret() and SetClientSecret() methods Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b6951b6925
commit
62d40a02d4
2 changed files with 4 additions and 8 deletions
|
|
@ -1783,20 +1783,16 @@ func TestProcessMessage_ModelRoutingUsesLightProvider(t *testing.T) {
|
||||||
ModelName: "gemini-main",
|
ModelName: "gemini-main",
|
||||||
Model: "gemini/gemini-2.5-flash",
|
Model: "gemini/gemini-2.5-flash",
|
||||||
APIBase: heavyServer.URL,
|
APIBase: heavyServer.URL,
|
||||||
|
APIKeys: config.SimpleSecureStrings("heavy-key"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ModelName: "qwen-light",
|
ModelName: "qwen-light",
|
||||||
Model: "ollama/qwen2.5:0.5b",
|
Model: "ollama/qwen2.5:0.5b",
|
||||||
APIBase: lightServer.URL,
|
APIBase: lightServer.URL,
|
||||||
|
APIKeys: config.SimpleSecureStrings("light-key"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
cfg.WithSecurity(&config.SecurityConfig{
|
|
||||||
ModelList: map[string]config.ModelSecurityEntry{
|
|
||||||
"gemini-main": {APIKeys: []string{"heavy-key"}},
|
|
||||||
"qwen-light": {APIKeys: []string{"light-key"}},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
msgBus := bus.NewMessageBus()
|
msgBus := bus.NewMessageBus()
|
||||||
provider, _, err := providers.CreateProvider(cfg)
|
provider, _, err := providers.CreateProvider(cfg)
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ func newTestDingTalkChannel(t *testing.T, cfg config.DingTalkConfig) (*DingTalkC
|
||||||
if cfg.ClientID == "" {
|
if cfg.ClientID == "" {
|
||||||
cfg.ClientID = "test-client-id"
|
cfg.ClientID = "test-client-id"
|
||||||
}
|
}
|
||||||
if cfg.ClientSecret() == "" {
|
if cfg.ClientSecret.String() == "" {
|
||||||
cfg.SetClientSecret("test-client-secret")
|
cfg.ClientSecret.Set("test-client-secret")
|
||||||
}
|
}
|
||||||
|
|
||||||
msgBus := bus.NewMessageBus()
|
msgBus := bus.NewMessageBus()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue