Skip to content

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

chore(host): reformat test assertions and remove unused import

Steven Enamakel3639fa26a0d2
diff --git a/crates/openhuman-core/src/tools/impl/network/gate_tests.rs b/crates/openhuman-core/src/tools/impl/network/gate_tests.rs
index a90f9377a6..a3451b2074 100644
--- a/crates/openhuman-core/src/tools/impl/network/gate_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/network/gate_tests.rs
@@ -64,7 +64,8 @@ fn local_only_privacy_mode_refuses_with_the_policy_blocked_marker() {
#[test]
fn standard_privacy_mode_lets_the_request_through() {
- let _mode = crate::security::live_policy::test_privacy_scope(crate::config::PrivacyMode::Standard);
+ let _mode =
+ crate::security::live_policy::test_privacy_scope(crate::config::PrivacyMode::Standard);
assert!(NetGate::local_only_block(&SecurityPolicy::default(), "example.com").is_none());
}
@@ -102,8 +103,16 @@ async fn http_request_is_blocked_under_local_only_privacy_mode() {
.await
.unwrap();
assert!(result.is_error);
- assert!(result.output().contains("[policy-blocked]"), "got: {}", result.output());
- assert!(result.output().contains("Local-only"), "got: {}", result.output());
+ assert!(
+ result.output().contains("[policy-blocked]"),
+ "got: {}",
+ result.output()
+ );
+ assert!(
+ result.output().contains("Local-only"),
+ "got: {}",
+ result.output()
+ );
}
#[tokio::test]
@@ -134,15 +143,26 @@ async fn web_fetch_and_curl_are_blocked_under_local_only_privacy_mode() {
.unwrap(),
] {
assert!(result.is_error);
- assert!(result.output().contains("[policy-blocked]"), "got: {}", result.output());
- assert!(result.output().contains("Local-only"), "got: {}", result.output());
+ assert!(
+ result.output().contains("[policy-blocked]"),
+ "got: {}",
+ result.output()
+ );
+ assert!(
+ result.output().contains("Local-only"),
+ "got: {}",
+ result.output()
+ );
}
}
#[tokio::test]
async fn pushover_honours_read_only_and_the_rate_limit() {
let read_only = PushoverTool::new(policy(AutonomyLevel::ReadOnly, 100), "/tmp".into());
- let result = read_only.execute(json!({"message": "hello"})).await.unwrap();
+ let result = read_only
+ .execute(json!({"message": "hello"}))
+ .await
+ .unwrap();
assert!(result.is_error);
assert!(result.output().contains("read-only"));
diff --git a/crates/openhuman-core/src/tools/impl/network/host.rs b/crates/openhuman-core/src/tools/impl/network/host.rs
index ea21c00e64..52fb495316 100644
--- a/crates/openhuman-core/src/tools/impl/network/host.rs
+++ b/crates/openhuman-core/src/tools/impl/network/host.rs
@@ -7,10 +7,7 @@
use std::sync::Arc;
-use serde_json::Value;
-use tinytools_std::network::{
- HtmlExtractor, HttpLimits, HttpRequestTool, NetGate, WebFetchTool,
-};
+use tinytools_std::network::{HtmlExtractor, HttpLimits, HttpRequestTool, NetGate, WebFetchTool};
use crate::config::HttpRequestConfig;
use crate::inference::tokenjuice::focus::{summary_focus_property, SUMMARY_FOCUS_ARG};
diff --git a/crates/openhuman-core/src/tools/impl/network/host_tests.rs b/crates/openhuman-core/src/tools/impl/network/host_tests.rs
index d57213003f..1a425a4819 100644
--- a/crates/openhuman-core/src/tools/impl/network/host_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/network/host_tests.rs
@@ -21,7 +21,9 @@ fn web_fetch_opts_into_an_optional_summary_focus() {
.unwrap()
.contains(&json!(SUMMARY_FOCUS_ARG)));
// The tool's schema declares TinyJuice's own property, not a lookalike.
- assert!(crate::inference::tokenjuice::focus::declares_summary_focus(&schema));
+ assert!(crate::inference::tokenjuice::focus::declares_summary_focus(
+ &schema
+ ));
}
/// The exact wire contract `web_fetch` had before it moved: name, description,