Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
|
|
@ -0,0 +1,28 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/router-for-me/CLIProxyAPI/v7/sdk/pluginapi"
|
||||
)
|
||||
|
||||
func TestBuildExecutionPlansForExecuteRespectsRouteTavily(t *testing.T) {
|
||||
currentConfig.Store(pluginConfig{
|
||||
Enabled: true,
|
||||
Route: string(backendTavily),
|
||||
TavilyAPIKeys: []string{"tvly-test"},
|
||||
})
|
||||
cfg := loadedConfig()
|
||||
req := pluginapi.ModelRouteRequest{
|
||||
SourceFormat: "claude",
|
||||
RequestedModel: "claude-sonnet-4-6",
|
||||
AvailableProviders: []string{"antigravity", "codex", "xai"},
|
||||
}
|
||||
plans := buildExecutionPlansForExecute(cfg, req)
|
||||
if len(plans) != 1 {
|
||||
t.Fatalf("plans len = %d, want 1 for route=tavily", len(plans))
|
||||
}
|
||||
if plans[0].backend != backendTavily {
|
||||
t.Fatalf("backend = %q, want tavily", plans[0].backend)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue