mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-01 17:00:21 +08:00
Fix Codex Spark quota formatting
This commit is contained in:
@@ -770,7 +770,9 @@ fn build_codex_quota_status_snapshot(
|
||||
window
|
||||
.get("code")
|
||||
.and_then(Value::as_str)
|
||||
.is_some_and(|code| code.eq_ignore_ascii_case("weekly") || code.eq_ignore_ascii_case("5h"))
|
||||
.is_some_and(|code| {
|
||||
code.eq_ignore_ascii_case("weekly") || code.eq_ignore_ascii_case("5h")
|
||||
})
|
||||
})
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
@@ -1053,9 +1053,18 @@ mod tests {
|
||||
assert_eq!(parsed.get("primary_used_percent"), Some(&json!(10.0)));
|
||||
assert_eq!(parsed.get("secondary_used_percent"), Some(&json!(25.0)));
|
||||
assert_eq!(parsed.get("spark_primary_used_percent"), Some(&json!(40.0)));
|
||||
assert_eq!(parsed.get("spark_primary_window_minutes"), Some(&json!(300u64)));
|
||||
assert_eq!(parsed.get("spark_secondary_used_percent"), Some(&json!(5.0)));
|
||||
assert_eq!(parsed.get("spark_secondary_window_minutes"), Some(&json!(10_080u64)));
|
||||
assert_eq!(
|
||||
parsed.get("spark_primary_window_minutes"),
|
||||
Some(&json!(300u64))
|
||||
);
|
||||
assert_eq!(
|
||||
parsed.get("spark_secondary_used_percent"),
|
||||
Some(&json!(5.0))
|
||||
);
|
||||
assert_eq!(
|
||||
parsed.get("spark_secondary_window_minutes"),
|
||||
Some(&json!(10_080u64))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user