Skip to content

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

refactor(core): clean up unused test helper functions

Steven Enamakelaa6f2ecddf2f
diff --git a/crates/openhuman-core/src/core/all_bound_controller_tests.rs b/crates/openhuman-core/src/core/all_bound_controller_tests.rs
index 2493784a86..2795ce9759 100644
--- a/crates/openhuman-core/src/core/all_bound_controller_tests.rs
+++ b/crates/openhuman-core/src/core/all_bound_controller_tests.rs
@@ -61,14 +61,6 @@ fn failing_parse(_params: Map<String, Value>) -> Result<Parsed, String> {
Err("parser rejected".to_owned())
}
-fn unused_contract_handler(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
- panic!("schema contract verification must not invoke controller handlers")
-}
-
-fn accept_contract_example(_params: Map<String, Value>) -> Result<(), String> {
- Ok(())
-}
-
fn schema() -> ControllerSchema {
ControllerSchema {
namespace: "bound_test",
@@ -322,22 +314,13 @@ fn production_registry_binds_composio_execute_to_its_declared_parser() {
);
}
- let required_contract = ControllerParamContract {
- method: "composio.execute",
- required: &["tool"],
- handler: unused_contract_handler,
- examples: vec![json!({"tool":"GMAIL_SEND_EMAIL"})],
- parse: accept_contract_example,
- };
- verify_parameter_schema(&entry.schema, &required_contract)
+ required_input_contract(&entry.schema, &["tool"])
.expect("independent required-field contract matches production schema");
let mut missing_required = entry.schema.clone();
missing_required.inputs.retain(|field| field.name != "tool");
- assert!(
- verify_parameter_schema(&missing_required, &required_contract)
- .unwrap_err()
- .contains("required inputs mismatch")
- );
+ assert!(required_input_contract(&missing_required, &["tool"])
+ .unwrap_err()
+ .contains("required inputs mismatch"));
let mut optional_required = entry.schema.clone();
optional_required
.inputs
@@ -345,11 +328,9 @@ fn production_registry_binds_composio_execute_to_its_declared_parser() {
.find(|field| field.name == "tool")
.expect("tool schema field")
.required = false;
- assert!(
- verify_parameter_schema(&optional_required, &required_contract)
- .unwrap_err()
- .contains("required inputs mismatch")
- );
+ assert!(required_input_contract(&optional_required, &["tool"])
+ .unwrap_err()
+ .contains("required inputs mismatch"));
for example in [
json!({"tool":"GMAIL_SEND_EMAIL"}),