mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 18:07:47 +08:00
同步完整网关回归的画像与目录契约并说明测试环境
This commit is contained in:
@@ -2663,14 +2663,11 @@ mod tests {
|
||||
assert_eq!(plans.len(), 2);
|
||||
assert!(plans[0].url.ends_with("/models?client_version=0.145.2"));
|
||||
assert!(plans[1].url.ends_with("/models?client_version=0.146.0"));
|
||||
assert_eq!(
|
||||
plans[0].headers.get("user-agent").map(String::as_str),
|
||||
Some("codex_cli_rs/0.145.2")
|
||||
);
|
||||
assert_eq!(
|
||||
plans[1].headers.get("user-agent").map(String::as_str),
|
||||
Some("codex_cli_rs/0.146.0")
|
||||
);
|
||||
for (plan, version) in plans.iter().zip(["0.145.2", "0.146.0"]) {
|
||||
let ua = plan.headers.get("user-agent").expect("画像应包含 UA");
|
||||
assert!(ua.starts_with(&format!("codex_cli_rs/{version} (")));
|
||||
assert!(ua.ends_with(") unknown"));
|
||||
}
|
||||
|
||||
let target = target();
|
||||
assert_ne!(
|
||||
|
||||
@@ -849,6 +849,12 @@ async fn gateway_handles_admin_provider_query_models_falls_back_to_codex_preset_
|
||||
"gpt-5.6-luna",
|
||||
"gpt-5.6-sol",
|
||||
"gpt-5.6-terra",
|
||||
"gpt-6-astra",
|
||||
"gpt-6-luna",
|
||||
"gpt-6-sol",
|
||||
"gpt-6.1-sol",
|
||||
"gpt-daybreak-blue-latest",
|
||||
"gpt-daybreak-red-latest",
|
||||
]
|
||||
);
|
||||
assert_eq!(
|
||||
|
||||
@@ -1270,10 +1270,9 @@ async fn run_versioned_codex_model_cards_frontdoor_scenario() {
|
||||
captured_catalog_plan.0,
|
||||
"https://chatgpt.example/backend-api/codex/models?client_version=0.145.2"
|
||||
);
|
||||
assert_eq!(
|
||||
captured_catalog_plan.1.as_deref(),
|
||||
Some("codex_cli_rs/0.145.2")
|
||||
);
|
||||
let captured_ua = captured_catalog_plan.1.expect("目录请求应包含 UA");
|
||||
assert!(captured_ua.starts_with("codex_cli_rs/0.145.2 ("));
|
||||
assert!(captured_ua.ends_with(") unknown"));
|
||||
|
||||
let fresh_response = client
|
||||
.get(format!("{gateway_url}/v1/models?client_version=0.145.2"))
|
||||
|
||||
Reference in New Issue
Block a user