diff --git a/backend/internal/handler/admin/admin_service_stub_test.go b/backend/internal/handler/admin/admin_service_stub_test.go index e9c9f43c..9f3dcf80 100644 --- a/backend/internal/handler/admin/admin_service_stub_test.go +++ b/backend/internal/handler/admin/admin_service_stub_test.go @@ -332,8 +332,8 @@ func (s *stubAdminService) CheckProxyQuality(ctx context.Context, id int64) (*se ProxyID: id, Score: 95, Grade: "A", - Summary: "通过 4 项,告警 0 项,失败 0 项,挑战 0 项", - PassedCount: 4, + Summary: "通过 5 项,告警 0 项,失败 0 项,挑战 0 项", + PassedCount: 5, WarnCount: 0, FailedCount: 0, ChallengeCount: 0, diff --git a/backend/internal/service/billing_service_test.go b/backend/internal/service/billing_service_test.go index bd173b96..5eb278f6 100644 --- a/backend/internal/service/billing_service_test.go +++ b/backend/internal/service/billing_service_test.go @@ -399,8 +399,8 @@ func TestCalculateCost_SupportsCacheBreakdown(t *testing.T) { InputPricePerToken: 3e-6, OutputPricePerToken: 15e-6, SupportsCacheBreakdown: true, - CacheCreation5mPrice: 4.0, // per million tokens - CacheCreation1hPrice: 5.0, // per million tokens + CacheCreation5mPrice: 4e-6, // per token + CacheCreation1hPrice: 5e-6, // per token }, }, } @@ -414,8 +414,8 @@ func TestCalculateCost_SupportsCacheBreakdown(t *testing.T) { cost, err := svc.CalculateCost("claude-sonnet-4", tokens, 1.0) require.NoError(t, err) - expected5m := float64(100000) / 1_000_000 * 4.0 - expected1h := float64(50000) / 1_000_000 * 5.0 + expected5m := float64(tokens.CacheCreation5mTokens) * 4e-6 + expected1h := float64(tokens.CacheCreation1hTokens) * 5e-6 require.InDelta(t, expected5m+expected1h, cost.CacheCreationCost, 1e-10) }