aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
35
akode-rs/cli/src/doctor/network_tests.rs
Normal file
35
akode-rs/cli/src/doctor/network_tests.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use pretty_assertions::assert_eq;
|
||||
use wiremock::Mock;
|
||||
use wiremock::MockServer;
|
||||
use wiremock::ResponseTemplate;
|
||||
use wiremock::matchers::method;
|
||||
|
||||
use super::super::CheckStatus;
|
||||
use super::super::ProviderAuthReachabilityMode;
|
||||
use super::super::provider_reachability_check;
|
||||
use super::super::provider_reachability_plan_from_parts;
|
||||
|
||||
#[tokio::test]
|
||||
async fn provider_reachability_rejects_proxy_authentication_challenges() {
|
||||
let proxy = MockServer::start().await;
|
||||
Mock::given(method("HEAD"))
|
||||
.respond_with(ResponseTemplate::new(407))
|
||||
.mount(&proxy)
|
||||
.await;
|
||||
let plan = provider_reachability_plan_from_parts(
|
||||
ProviderAuthReachabilityMode::NotRequired,
|
||||
"local",
|
||||
"Local",
|
||||
Some(&format!("{}/v1", proxy.uri())),
|
||||
/*provider_query_params*/ None,
|
||||
);
|
||||
|
||||
let check = provider_reachability_check(plan).await;
|
||||
assert_eq!(check.status, CheckStatus::Fail);
|
||||
assert!(
|
||||
check
|
||||
.details
|
||||
.join(" ")
|
||||
.contains("proxy authentication required (HTTP 407)")
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user