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