mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-04 08:27:46 +08:00
test(claude-code): 批量授权测试兼容授权后异步额度刷新
This commit is contained in:
@@ -410,6 +410,10 @@ async fn gateway_authorizes_claude_cookie_without_persisting_cookie_impl() {
|
|||||||
"email_address": "[email protected]"
|
"email_address": "[email protected]"
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
// Newly authorized accounts get their 5H/weekly quota fetched right away.
|
||||||
|
quota if quota.starts_with("claude-code-quota:") => {
|
||||||
|
json!({"five_hour": {"utilization": 10.0}})
|
||||||
|
}
|
||||||
unexpected => panic!("unexpected execution plan: {unexpected}"),
|
unexpected => panic!("unexpected execution plan: {unexpected}"),
|
||||||
};
|
};
|
||||||
Json(json!({
|
Json(json!({
|
||||||
@@ -811,7 +815,15 @@ async fn gateway_batch_authorizes_claude_cookies_as_redacted_task_impl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let plans = execution_plans.lock().expect("mutex should lock");
|
let plans = execution_plans.lock().expect("mutex should lock");
|
||||||
assert_eq!(plans.len(), 6);
|
// Post-authorization quota refreshes are fire-and-forget, so their count is not
|
||||||
|
// deterministic here; only the OAuth flow plans are asserted.
|
||||||
|
assert_eq!(
|
||||||
|
plans
|
||||||
|
.iter()
|
||||||
|
.filter(|plan| !plan.request_id.starts_with("claude-code-quota:"))
|
||||||
|
.count(),
|
||||||
|
6
|
||||||
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
plans
|
plans
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
Reference in New Issue
Block a user