mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-02 13:57:29 +08:00
release: v0.2.0
This commit is contained in:
@@ -24,16 +24,21 @@ func TestStatusCmdUsesActiveProviderDetails(t *testing.T) {
|
||||
cfg := config.DefaultConfig()
|
||||
cfg.Logging.Enabled = false
|
||||
cfg.Agents.Defaults.Workspace = workspace
|
||||
cfg.Agents.Defaults.Proxy = "backup"
|
||||
cfg.Agents.Defaults.Model.Primary = "backup/backup-model"
|
||||
cfg.Gateway.Nodes.P2P.Enabled = true
|
||||
cfg.Gateway.Nodes.P2P.Transport = "webrtc"
|
||||
cfg.Gateway.Nodes.P2P.STUNServers = []string{"stun:stun.example.net:3478"}
|
||||
cfg.Gateway.Nodes.P2P.ICEServers = []config.GatewayICEConfig{
|
||||
{URLs: []string{"turn:turn.example.net:3478"}, Username: "user", Credential: "secret"},
|
||||
}
|
||||
cfg.Providers.Proxy.APIBase = "https://primary.example/v1"
|
||||
cfg.Providers.Proxy.APIKey = ""
|
||||
cfg.Providers.Proxies["backup"] = config.ProviderConfig{
|
||||
cfg.Models.Providers["openai"] = config.ProviderConfig{
|
||||
APIBase: "https://primary.example/v1",
|
||||
APIKey: "",
|
||||
Models: []string{"gpt-5.4"},
|
||||
Auth: "bearer",
|
||||
TimeoutSec: 30,
|
||||
}
|
||||
cfg.Models.Providers["backup"] = config.ProviderConfig{
|
||||
APIBase: "https://backup.example/v1",
|
||||
APIKey: "backup-key",
|
||||
Models: []string{"backup-model"},
|
||||
@@ -65,13 +70,13 @@ func TestStatusCmdUsesActiveProviderDetails(t *testing.T) {
|
||||
}
|
||||
|
||||
out := buf.String()
|
||||
if !strings.Contains(out, "Proxy: backup") {
|
||||
t.Fatalf("expected backup proxy in output, got: %s", out)
|
||||
if !strings.Contains(out, "Primary Provider: backup") {
|
||||
t.Fatalf("expected backup provider in output, got: %s", out)
|
||||
}
|
||||
if !strings.Contains(out, "Provider API Base: https://backup.example/v1") {
|
||||
if !strings.Contains(out, "Provider Base URL: https://backup.example/v1") {
|
||||
t.Fatalf("expected active provider api base in output, got: %s", out)
|
||||
}
|
||||
if !strings.Contains(out, "Provider API Key: configured") {
|
||||
if !strings.Contains(out, "API Key Status: configured") {
|
||||
t.Fatalf("expected active provider api key status in output, got: %s", out)
|
||||
}
|
||||
if !strings.Contains(out, "Nodes P2P: enabled=true transport=webrtc") {
|
||||
|
||||
Reference in New Issue
Block a user