Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

style: apply rustfmt formatting to test modules

Steven Enamakel82543d8f2f16
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
index e696e169be..41a7f609e3 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
@@ -536,7 +536,7 @@ fn closed_session_is_not_reusable() {
#[test]
fn an_equal_millisecond_live_close_persists_and_a_stale_snapshot_cannot_reopen_it() {
use crate::agent::orchestration::subagent_sessions::store_documents::{with_override, Docs};
- use crate::storage::{Scope, StorageBackend, test_support::memory_backend};
+ use crate::storage::{test_support::memory_backend, Scope, StorageBackend};
let storage = memory_backend();
let docs = Docs::over(&storage.for_scope(&Scope::new("local").unwrap()).unwrap());
diff --git a/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs b/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs
index 3ac0992186..4660f73874 100644
--- a/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs
+++ b/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs
@@ -1,12 +1,12 @@
use async_trait::async_trait;
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use std::path::Path;
use std::sync::Arc;
use tinyagents_harness::media::MediaOutput;
use tinystoragedrivers_api::BlobStore;
use tinytools::{PermissionLevel, Tool, ToolCategory, ToolContent, ToolResult};
-use super::{MediaArtifactTool, copy_blob_to_file, has_reusable_files_reference};
+use super::{copy_blob_to_file, has_reusable_files_reference, MediaArtifactTool};
use crate::artifacts::{ArtifactKind, ArtifactStatus, FileRoots};
#[test]
@@ -62,11 +62,10 @@ async fn artifact_history_refresh_failure_fails_closed_for_cached_files() {
.with_reference_allowlist(Arc::clone(&allowed));
assert!(allowed.lock().unwrap().contains(&replacement));
- assert!(
- tool.execute(json!({ "references": [replacement.to_string_lossy()] }))
- .await
- .is_err()
- );
+ assert!(tool
+ .execute(json!({ "references": [replacement.to_string_lossy()] }))
+ .await
+ .is_err());
}
struct PartialThenFail(bool);
@@ -223,13 +222,11 @@ async fn files_a_blob_backed_generated_artifact() {
Some(format!("Saved image at {}\nCost: $0.01", canonical_file.display()).as_str())
);
assert_eq!(std::fs::read(&file).unwrap(), b"blob-media-bytes");
- assert!(
- blobs
- .get("generated-media/stub-0.png")
- .await
- .unwrap()
- .is_none()
- );
+ assert!(blobs
+ .get("generated-media/stub-0.png")
+ .await
+ .unwrap()
+ .is_none());
let (_, failed_file) = crate::artifacts::create_artifact_for_call(
&workspace,
@@ -292,15 +289,13 @@ async fn files_a_blob_backed_generated_artifact() {
"failed regeneration retains the previous non-empty file"
);
fresh.refresh_allowed_references().await.unwrap();
- assert!(
- !fresh
- .allowed_references
- .as_ref()
- .unwrap()
- .lock()
- .unwrap()
- .contains(&canonical_file)
- );
+ assert!(!fresh
+ .allowed_references
+ .as_ref()
+ .unwrap()
+ .lock()
+ .unwrap()
+ .contains(&canonical_file));
}
#[tokio::test]
@@ -438,11 +433,10 @@ async fn files_every_artifact_when_n_greater_than_one() {
.await
.expect("artifact metadata is persisted");
assert_eq!(meta.status, ArtifactStatus::Ready);
- assert!(
- meta.file
- .as_deref()
- .is_some_and(|file| std::path::Path::new(file).exists())
- );
+ assert!(meta
+ .file
+ .as_deref()
+ .is_some_and(|file| std::path::Path::new(file).exists()));
}
}
diff --git a/crates/openhuman-core/src/profiles/lifecycle_tests.rs b/crates/openhuman-core/src/profiles/lifecycle_tests.rs
index ec15ebf5b8..fa03a0e419 100644
--- a/crates/openhuman-core/src/profiles/lifecycle_tests.rs
+++ b/crates/openhuman-core/src/profiles/lifecycle_tests.rs
@@ -10,7 +10,7 @@ use crate::core::runtime::{DomainSet, SaasConfig};
use crate::profiles::credentials::UserCredentialKind;
use crate::profiles::OpenError;
use crate::storage::lease::{LeaseRecord, LeaseStore};
-use crate::storage::{StorageBackend, test_support::memory_backend};
+use crate::storage::{test_support::memory_backend, StorageBackend};
fn saas(root: &std::path::Path, node: &str) -> SaasConfig {
let mut saas = SaasConfig::new(root);
diff --git a/crates/openhuman-core/src/storage/secrets_tests.rs b/crates/openhuman-core/src/storage/secrets_tests.rs
index e3ffcc21b0..e39302ae15 100644
--- a/crates/openhuman-core/src/storage/secrets_tests.rs
+++ b/crates/openhuman-core/src/storage/secrets_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::storage::{Scope, StorageBackend, test_support::memory_backend};
+use crate::storage::{test_support::memory_backend, Scope, StorageBackend};
fn keys(byte: u8) -> Arc<dyn KeyProvider> {
Arc::new(DerivedKeys::new(Zeroizing::new([byte; 32])))
@@ -28,7 +28,12 @@ fn a_secret_round_trips_from_sync_code() {
#[test]
fn scopes_and_keys_keep_secrets_apart() {
let storage = memory_backend();
- set_blocking(&secrets_in(storage.as_ref(), "alice", 7), "user:token", b"a").unwrap();
+ set_blocking(
+ &secrets_in(storage.as_ref(), "alice", 7),
+ "user:token",
+ b"a",
+ )
+ .unwrap();
assert!(
get_blocking(&secrets_in(storage.as_ref(), "bob", 7), "user:token")
.unwrap()
diff --git a/crates/openhuman-core/src/storage/sessions/mod_tests.rs b/crates/openhuman-core/src/storage/sessions/mod_tests.rs
index d19f119aae..aa14feb24a 100644
--- a/crates/openhuman-core/src/storage/sessions/mod_tests.rs
+++ b/crates/openhuman-core/src/storage/sessions/mod_tests.rs
@@ -319,13 +319,11 @@ async fn a_stashed_attachment_survives_a_restart_of_the_workspace_store() {
resumed.read_data_uri("att-1").await.unwrap().as_deref(),
Some(data_uri)
);
- assert!(
- resumed
- .read_data_uri("never-stashed")
- .await
- .unwrap()
- .is_none()
- );
+ assert!(resumed
+ .read_data_uri("never-stashed")
+ .await
+ .unwrap()
+ .is_none());
}
#[test]