From 74ac905abf7fd907f3d3c128cde8c08efde27e6d Mon Sep 17 00:00:00 2001 From: Zyy Date: Thu, 26 Nov 2026 11:54:18 +0800 Subject: [PATCH] test(openai): borrow quota window attribution in assertions Co-authored-by: Codex --- .../providers/openai/tests/admin/provider.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/crates/providers/openai/tests/admin/provider.rs b/backend/crates/providers/openai/tests/admin/provider.rs index 434816cce..1b953e3ef 100644 --- a/backend/crates/providers/openai/tests/admin/provider.rs +++ b/backend/crates/providers/openai/tests/admin/provider.rs @@ -1564,6 +1564,10 @@ async fn openai_admin_provider_projects_official_codex_quota_and_independent_buc .collect::>(); assert_eq!(monthly.len(), 1); + assert_eq!( + monthly[0].local_usage_attribution, + QuotaLocalUsageAttribution::AccountWide + ); assert!(monthly.iter().any(|window| { window.label == "月额度" && window.limit_id.as_deref() == Some("codex") @@ -1594,22 +1598,18 @@ async fn openai_admin_provider_projects_official_codex_quota_and_independent_buc assert_eq!(review.label, "周额度"); assert_eq!(review.limit_name.as_deref(), Some("code_review")); assert_eq!(review.role, Some(ProviderQuotaWindowRole::Primary)); + assert_eq!( + review.local_usage_attribution, + QuotaLocalUsageAttribution::Unavailable + ); let spark = quota .windows .iter() .find(|window| window.limit_id.as_deref() == Some("codex_bengalfox")) .expect("Spark quota"); assert_eq!( - ( - monthly[0].local_usage_attribution, - review.local_usage_attribution, - spark.local_usage_attribution, - ), - ( - QuotaLocalUsageAttribution::AccountWide, - QuotaLocalUsageAttribution::Unavailable, - QuotaLocalUsageAttribution::Unavailable, - ), + spark.local_usage_attribution, + QuotaLocalUsageAttribution::Unavailable ); }