Skip to content

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

test(tests): update various tests for better formatting and assertions

Steven Enamakel3868a4b6892b
diff --git a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
index 9e9aa58dac..9bffba3987 100644
--- a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
@@ -474,7 +474,9 @@ fn configured_openhuman_jwt_slug_routes_to_managed_chat_model() {
let _guard = crate::inference::inference_test_guard();
install_test_managed_provider();
let mut config = Config::default();
- config.cloud_providers.push(fixture_managed_entry("p_fixture"));
+ config
+ .cloud_providers
+ .push(fixture_managed_entry("p_fixture"));
config.chat_provider = Some("fixture-managed:hint:reasoning".to_string());
let (model, model_id) =
@@ -490,7 +492,10 @@ fn configured_openhuman_jwt_slug_routes_to_managed_chat_model() {
.expect("registered host policy should recognize this route")
.expect("registered model should build");
assert_eq!(pinned_id, "vendor/pinned");
- assert!(model.profile().is_none(), "the generic fixture has no host profile");
+ assert!(
+ model.profile().is_none(),
+ "the generic fixture has no host profile"
+ );
crate::inference::registry::unregister_chat_model(
crate::inference::provider::factory::PROVIDER_OPENHUMAN,
);
@@ -509,7 +514,9 @@ async fn openhuman_jwt_slug_discloses_pinned_model() {
let marker = "egress-jwt-pinned-marker-v1";
let mut config = Config::default();
- config.cloud_providers.push(fixture_managed_entry("p_fixture"));
+ config
+ .cloud_providers
+ .push(fixture_managed_entry("p_fixture"));
let provider = format!("fixture-managed:{marker}");
let _ = try_create_cloud_slug_chat_model_from_string(
"chat",
@@ -517,8 +524,8 @@ async fn openhuman_jwt_slug_discloses_pinned_model() {
&config,
&EgressLedger::none(),
)
- .expect("registered host policy should recognize this route")
- .expect("registered model should build");
+ .expect("registered host policy should recognize this route")
+ .expect("registered model should build");
let sentinel = "egress-jwt-pinned-sentinel-end";
crate::core::bus::BUS.publish(DomainEvent::ExternalTransferPending {
@@ -648,7 +655,9 @@ fn openhuman_jwt_slug_preserves_forced_text_mode() {
let _guard = crate::inference::inference_test_guard();
let native_modes = install_test_managed_provider();
let mut config = Config::default();
- config.cloud_providers.push(fixture_managed_entry("p_fixture"));
+ config
+ .cloud_providers
+ .push(fixture_managed_entry("p_fixture"));
let (_model, _) = try_create_cloud_slug_chat_model_from_string_with_native_tools(
"chat",
@@ -671,7 +680,9 @@ fn openhuman_jwt_slug_without_model_preserves_managed_role_tier() {
let _guard = crate::inference::inference_test_guard();
install_test_managed_provider();
let mut config = Config::default();
- config.cloud_providers.push(fixture_managed_entry("p_fixture"));
+ config
+ .cloud_providers
+ .push(fixture_managed_entry("p_fixture"));
let (_model, model_id) = try_create_cloud_slug_chat_model_from_string(
"summarization",
diff --git a/crates/openhuman-core/src/inference/provider/factory_tests.rs b/crates/openhuman-core/src/inference/provider/factory_tests.rs
index 187c460888..a1f202dac2 100644
--- a/crates/openhuman-core/src/inference/provider/factory_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_tests.rs
@@ -15,7 +15,9 @@ impl ChatModel<()> for ManagedRouteFixtureModel {
_state: &(),
_request: tinyinference_llm::model::ModelRequest,
) -> tinyinference_llm::Result<tinyinference_llm::model::ModelResponse> {
- Ok(tinyinference_llm::model::ModelResponse::assistant("fixture"))
+ Ok(tinyinference_llm::model::ModelResponse::assistant(
+ "fixture",
+ ))
}
}
diff --git a/crates/openhuman-core/src/inference/provider/http_error_tests.rs b/crates/openhuman-core/src/inference/provider/http_error_tests.rs
index 2e2bd4a0f1..b9e2d00e6b 100644
--- a/crates/openhuman-core/src/inference/provider/http_error_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/http_error_tests.rs
@@ -152,7 +152,9 @@ async fn backend_provider_does_not_get_byo_key_rejection() {
)
.await;
let rejected = drain_until(&mut rx, |e| match e {
- DomainEvent::ProviderApiKeyRejected { provider, .. } if provider == FIXTURE_BACKEND => Some(()),
+ DomainEvent::ProviderApiKeyRejected { provider, .. } if provider == FIXTURE_BACKEND => {
+ Some(())
+ }
_ => None,
});
assert!(
diff --git a/crates/openhuman-core/src/inference/provider/models/mod_tests.rs b/crates/openhuman-core/src/inference/provider/models/mod_tests.rs
index 966a2fb194..dd8cb25424 100644
--- a/crates/openhuman-core/src/inference/provider/models/mod_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/models/mod_tests.rs
@@ -126,8 +126,9 @@ async fn unregistered_managed_catalog_lists_no_models() {
"https://managed.example/v1",
AuthStyle::OpenhumanJwt,
);
- let outcome = super::catalog_listing::list_configured_models_from_config("fixture-managed", &config)
- .await
- .expect("an unregistered host-owned catalog is empty, not an error");
+ let outcome =
+ super::catalog_listing::list_configured_models_from_config("fixture-managed", &config)
+ .await
+ .expect("an unregistered host-owned catalog is empty, not an error");
assert_eq!(outcome.value["models"], serde_json::json!([]));
}
diff --git a/crates/openhuman-core/src/platform/cost/route_tests.rs b/crates/openhuman-core/src/platform/cost/route_tests.rs
index f5a4dabc05..66dbabe5d6 100644
--- a/crates/openhuman-core/src/platform/cost/route_tests.rs
+++ b/crates/openhuman-core/src/platform/cost/route_tests.rs
@@ -81,10 +81,10 @@ fn byok_and_local_models_are_not_managed() {
#[test]
fn normalizes_case_whitespace_and_prefixes() {
- assert_eq!(route_for_model(" Chat-V1 "), CostRoute::Managed);
- assert_eq!(route_for_model("hint:chat-v1"), CostRoute::Managed);
+ assert_eq!(route_for_model(" HINT:CHAT "), CostRoute::Managed);
+ assert_eq!(route_for_model("hint:chat"), CostRoute::Managed);
assert_eq!(
- route_for_model("openhuman/reasoning-v1"),
+ route_for_model("openhuman/hint:reasoning"),
CostRoute::Managed
);
}