style: format proxmox client code with cargo fmt
Some checks failed
PR Review Automation / review (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Successful in 1m46s
Test / frontend-typecheck (pull_request) Successful in 1m53s
Test / rust-fmt-check (pull_request) Successful in 12m1s
Test / rust-clippy (pull_request) Successful in 13m25s
Test / rust-tests (pull_request) Successful in 15m37s

This commit is contained in:
Shaun Arman 2026-06-20 21:56:49 -05:00
parent cec962b349
commit bad3042d2d

View File

@ -349,7 +349,7 @@ mod tests {
fn test_auth_response_envelope_deserialization() {
// Validates that the `{"data": {...}}` envelope Proxmox uses is parsed
// correctly into ProxmoxEnvelope<AuthResponse>.
// Note: Proxmox returns lowercase fields (ticket, username, clustername)
// Note: Proxmox returns lowercase fields (ticket, username, clustername)
// except for CSRFPreventionToken which is PascalCase.
let json = r#"{
"data": {
@ -431,7 +431,7 @@ mod tests {
return;
}
};
let mut client = ProxmoxClient::new("172.0.0.18", 8006, "root@pam");
let result = client.authenticate(&password).await;
match result {
@ -456,9 +456,12 @@ mod tests {
return;
}
};
let mut client = ProxmoxClient::new("172.0.0.18", 8006, "root@pam");
client.authenticate(&password).await.expect("Authentication failed");
client
.authenticate(&password)
.await
.expect("Authentication failed");
#[derive(serde::Deserialize, Debug)]
struct Resource {
@ -470,7 +473,9 @@ mod tests {
status: Option<String>,
}
let result: Result<Vec<Resource>, _> = client.get("cluster/resources", client.ticket.as_deref()).await;
let result: Result<Vec<Resource>, _> = client
.get("cluster/resources", client.ticket.as_deref())
.await;
match result {
Ok(resources) => {
println!("✓ Cluster resources fetched successfully");
@ -496,9 +501,12 @@ mod tests {
return;
}
};
let mut client = ProxmoxClient::new("proxmox-server", 8006, "root@pam");
client.authenticate(&password).await.expect("Authentication failed");
client
.authenticate(&password)
.await
.expect("Authentication failed");
#[derive(serde::Deserialize, Debug)]
struct Node {
@ -535,9 +543,12 @@ mod tests {
return;
}
};
let mut client = ProxmoxClient::new("proxmox-server", 8006, "root@pam");
client.authenticate(&password).await.expect("Authentication failed");
client
.authenticate(&password)
.await
.expect("Authentication failed");
#[derive(serde::Deserialize, Debug)]
struct Resource {
@ -548,10 +559,15 @@ mod tests {
status: Option<String>,
}
let result: Result<Vec<Resource>, _> = client.get("cluster/resources", client.ticket.as_deref()).await;
let result: Result<Vec<Resource>, _> = client
.get("cluster/resources", client.ticket.as_deref())
.await;
match result {
Ok(resources) => {
let vms: Vec<_> = resources.into_iter().filter(|r| r.r#type.as_deref() == Some("qemu")).collect();
let vms: Vec<_> = resources
.into_iter()
.filter(|r| r.r#type.as_deref() == Some("qemu"))
.collect();
println!("✓ VMs fetched successfully");
println!(" Found {} VMs", vms.len());
}