Skip to content

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

test(mcp): reformat assertions and drop stray blank line

Steven Enamakel2342af0be2fc
diff --git a/crates/openhuman-core/src/mcp/host_tests.rs b/crates/openhuman-core/src/mcp/host_tests.rs
index 37b54bf86e..134fce8bae 100644
--- a/crates/openhuman-core/src/mcp/host_tests.rs
+++ b/crates/openhuman-core/src/mcp/host_tests.rs
@@ -39,18 +39,27 @@ fn declared_server_fields_and_identity_survive_conversion() {
assert_eq!(server.endpoint, "https://example.test/mcp");
assert_eq!(server.command, "npx");
assert_eq!(server.args, ["-y", "weather-mcp"]);
- assert_eq!(server.env.get("API_KEY").map(String::as_str), Some("secret"));
+ assert_eq!(
+ server.env.get("API_KEY").map(String::as_str),
+ Some("secret")
+ );
assert_eq!(server.cwd.as_deref(), Some("/workspace"));
assert_eq!(server.description.as_deref(), Some("Weather lookups"));
assert!(!server.enabled);
assert_eq!(server.allowed_tools, ["forecast"]);
assert_eq!(server.disallowed_tools, ["debug"]);
assert_eq!(server.timeout_secs, 9);
- assert_eq!(server.auth, McpAuthConfig::BearerToken { token: "t".into() });
+ assert_eq!(
+ server.auth,
+ McpAuthConfig::BearerToken { token: "t".into() }
+ );
assert_eq!(converted.client_identity.name, "openhuman-core");
assert_eq!(converted.client_identity.title, "OpenHuman Core MCP Client");
assert_eq!(converted.client_identity.version, "9.9.9");
- assert_eq!(converted.registry_auth.smithery_api_key.as_deref(), Some("smithery"));
+ assert_eq!(
+ converted.registry_auth.smithery_api_key.as_deref(),
+ Some("smithery")
+ );
}
#[test]
@@ -58,13 +67,30 @@ fn every_credential_kind_converts_without_shape_changes() {
let cases = [
McpAuthConfig::None,
McpAuthConfig::BearerToken { token: "t".into() },
- McpAuthConfig::Basic { username: "u".into(), password: "p".into() },
- McpAuthConfig::Header { name: "X-Key".into(), value: "v".into() },
- McpAuthConfig::QueryParam { name: "key".into(), value: "v".into() },
- McpAuthConfig::Headers { headers: vec![
- HttpHeader { name: "X-Key".into(), value: "k".into() },
- HttpHeader { name: "Authorization".into(), value: "Bearer s".into() },
- ] },
+ McpAuthConfig::Basic {
+ username: "u".into(),
+ password: "p".into(),
+ },
+ McpAuthConfig::Header {
+ name: "X-Key".into(),
+ value: "v".into(),
+ },
+ McpAuthConfig::QueryParam {
+ name: "key".into(),
+ value: "v".into(),
+ },
+ McpAuthConfig::Headers {
+ headers: vec![
+ HttpHeader {
+ name: "X-Key".into(),
+ value: "k".into(),
+ },
+ HttpHeader {
+ name: "Authorization".into(),
+ value: "Bearer s".into(),
+ },
+ ],
+ },
];
for auth in cases {
diff --git a/crates/openhuman-core/src/mcp/registry/helpers.rs b/crates/openhuman-core/src/mcp/registry/helpers.rs
index c7635c61ef..4fded65337 100644
--- a/crates/openhuman-core/src/mcp/registry/helpers.rs
+++ b/crates/openhuman-core/src/mcp/registry/helpers.rs
@@ -7,7 +7,6 @@
use serde_json::{json, Value};
-
/// Renders a value into the `Outcome` payload the frontend expects.
pub(crate) fn encode<T: serde::Serialize>(value: &T) -> Result<Value, String> {
serde_json::to_value(value).map_err(|error| format!("serialization error: {error}"))
diff --git a/crates/openhuman-core/src/tools/impl/network/mcp_server_tools_tests.rs b/crates/openhuman-core/src/tools/impl/network/mcp_server_tools_tests.rs
index e42533c9f5..be002a20ea 100644
--- a/crates/openhuman-core/src/tools/impl/network/mcp_server_tools_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/network/mcp_server_tools_tests.rs
@@ -17,14 +17,17 @@ fn presentation(server_id: &str, deferred: bool) -> tinymcp_bus::McpToolPresenta
fn config() -> Config {
let mut config = Config::default();
- config.mcp_client.servers.push(crate::config::McpServerConfig {
- server: tinymcp_bus::McpServerConfig {
- name: "weather".into(),
- endpoint: "https://example.test/mcp".into(),
+ config
+ .mcp_client
+ .servers
+ .push(crate::config::McpServerConfig {
+ server: tinymcp_bus::McpServerConfig {
+ name: "weather".into(),
+ endpoint: "https://example.test/mcp".into(),
+ ..Default::default()
+ },
..Default::default()
- },
- ..Default::default()
- });
+ });
config
}
@@ -45,7 +48,10 @@ fn module_prepared_static_tool_keeps_its_contract_and_exposure() {
let tool = tools.pop().expect("prepared tool");
assert_eq!(tool.name(), "mcp_weather_forecast");
assert_eq!(tool.description(), "Read the forecast");
- assert_eq!(tool.parameters_schema()["properties"]["city"]["type"], "string");
+ assert_eq!(
+ tool.parameters_schema()["properties"]["city"]["type"],
+ "string"
+ );
assert_eq!(tool.exposure(), ToolExposure::Deferred);
assert_eq!(tool.family(), Some("weather"));
}