Files
multica/server/internal/metrics/pricing_test.go
Bohan Jiang b1c8eb5f11 feat: support Claude Fable 5 pricing (#3982)
Co-authored-by: J <j@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-10 12:33:27 +08:00

34 lines
970 B
Go

package metrics
import "testing"
func TestPriceForModelAliasAnthropicFableAndOpus48(t *testing.T) {
cases := []struct {
model string
want ModelPrice
}{
{
model: "claude-fable-5",
want: ModelPrice{Provider: "anthropic", Model: "claude-fable-5", InputPerM: 10, CacheReadPerM: 1, CacheWritePerM: 12.5, OutputPerM: 50},
},
{
model: "anthropic/claude-fable-5",
want: ModelPrice{Provider: "anthropic", Model: "claude-fable-5", InputPerM: 10, CacheReadPerM: 1, CacheWritePerM: 12.5, OutputPerM: 50},
},
{
model: "claude-opus-4-8",
want: ModelPrice{Provider: "anthropic", Model: "claude-opus-4.8", InputPerM: 5, CacheReadPerM: 0.5, CacheWritePerM: 6.25, OutputPerM: 25},
},
}
for _, tc := range cases {
got, ok := PriceForModelAlias(tc.model)
if !ok {
t.Fatalf("PriceForModelAlias(%q) did not resolve", tc.model)
}
if got != tc.want {
t.Fatalf("PriceForModelAlias(%q) = %+v, want %+v", tc.model, got, tc.want)
}
}
}