add test
This commit is contained in:
parent
632c1128f6
commit
75e433e4b8
1 changed files with 25 additions and 0 deletions
|
|
@ -34,6 +34,12 @@ func TestExtractProtocol(t *testing.T) {
|
|||
wantProtocol: "anthropic",
|
||||
wantModelID: "claude-sonnet-4.6",
|
||||
},
|
||||
{
|
||||
name: "claude with prefix",
|
||||
model: "claude/claude-sonnet-4.6",
|
||||
wantProtocol: "claude",
|
||||
wantModelID: "claude-sonnet-4.6",
|
||||
},
|
||||
{
|
||||
name: "no prefix - defaults to openai",
|
||||
model: "gpt-4o",
|
||||
|
|
@ -154,6 +160,25 @@ func TestCreateProviderFromConfig_Anthropic(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestCreateProviderFromConfig_Claudue(t *testing.T) {
|
||||
cfg := &config.ModelConfig{
|
||||
ModelName: "test-anthropic",
|
||||
Model: "claude/claude-sonnet-4.6",
|
||||
APIKey: "test-key",
|
||||
}
|
||||
|
||||
provider, modelID, err := CreateProviderFromConfig(cfg)
|
||||
if err != nil {
|
||||
t.Fatalf("CreateProviderFromConfig() error = %v", err)
|
||||
}
|
||||
if provider == nil {
|
||||
t.Fatal("CreateProviderFromConfig() returned nil provider")
|
||||
}
|
||||
if modelID != "claude-sonnet-4.6" {
|
||||
t.Errorf("modelID = %q, want %q", modelID, "claude-sonnet-4.6")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateProviderFromConfig_Antigravity(t *testing.T) {
|
||||
cfg := &config.ModelConfig{
|
||||
ModelName: "test-antigravity",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue