Skip to content

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

test(inbound): reformat delivery tests to satisfy line width

Steven Enamakelaa4105ad6dcc
diff --git a/crates/openhuman-core/src/inbound/deliver_tests.rs b/crates/openhuman-core/src/inbound/deliver_tests.rs
index 035c4036f0..d985d4c91b 100644
--- a/crates/openhuman-core/src/inbound/deliver_tests.rs
+++ b/crates/openhuman-core/src/inbound/deliver_tests.rs
@@ -515,8 +515,7 @@ impl tinybus::EventHandler<DomainEvent> for CompletedFor {
}
async fn handle(&self, event: &DomainEvent) {
- if matches!(event, DomainEvent::InboundTurnCompleted { turn_id, .. } if turn_id == self.1)
- {
+ if matches!(event, DomainEvent::InboundTurnCompleted { turn_id, .. } if turn_id == self.1) {
*self.0.lock().unwrap() += 1;
}
}
@@ -546,17 +545,28 @@ async fn an_injected_event_is_left_out_of_the_prompt_and_listed_as_blocked() {
assert_eq!(runs.len(), 1, "one model call for the batch");
let message = &runs[0].message;
assert!(message.contains("loving the new release") && message.contains("next meetup"));
- assert!(!message.contains("Ignore all previous instructions"), "{message}");
+ assert!(
+ !message.contains("Ignore all previous instructions"),
+ "{message}"
+ );
assert!(!message.contains("\"t2\""), "{message}");
let stored = results.get("turn-screened").unwrap().unwrap();
assert_eq!(stored.result.status, ResultStatus::Completed);
assert_eq!(stored.result.text.as_deref(), Some("two drafts"));
assert_eq!(stored.result.event_ids, ["t1", "t2", "t3"]);
- let blocked: Vec<&str> = stored.result.blocked.iter().map(|b| b.event_id.as_str()).collect();
+ let blocked: Vec<&str> = stored
+ .result
+ .blocked
+ .iter()
+ .map(|b| b.event_id.as_str())
+ .collect();
assert_eq!(blocked, ["t2"]);
let reason = &stored.result.blocked[0].reason;
assert!(!reason.is_empty());
- assert!(!reason.to_lowercase().contains("ignore"), "user text in reason: {reason}");
+ assert!(
+ !reason.to_lowercase().contains("ignore"),
+ "user text in reason: {reason}"
+ );
}
#[tokio::test]
@@ -570,7 +580,10 @@ async fn an_all_injection_batch_completes_without_calling_the_model() {
let response = pinned_deliverer(&triage, &agent, &results)
.deliver(pinned_turn(
"turn-all-blocked",
- vec![mention_saying("t1", INJECTION), mention_saying("t2", INJECTION)],
+ vec![
+ mention_saying("t1", INJECTION),
+ mention_saying("t2", INJECTION),
+ ],
))
.await;
assert_eq!(response.status, DeliverStatus::Accepted);
@@ -579,14 +592,23 @@ async fn an_all_injection_batch_completes_without_calling_the_model() {
assert_eq!(stored.result.status, ResultStatus::Completed);
assert_eq!(stored.result.text.as_deref(), Some(""));
assert_eq!(
- stored.result.blocked.iter().map(|b| b.event_id.as_str()).collect::<Vec<_>>(),
+ stored
+ .result
+ .blocked
+ .iter()
+ .map(|b| b.event_id.as_str())
+ .collect::<Vec<_>>(),
["t1", "t2"]
);
let deadline = tokio::time::Instant::now() + Duration::from_secs(5);
while *seen.0.lock().unwrap() == 0 && tokio::time::Instant::now() < deadline {
tokio::time::sleep(Duration::from_millis(10)).await;
}
- assert_eq!(*seen.0.lock().unwrap(), 1, "InboundTurnCompleted not published once");
+ assert_eq!(
+ *seen.0.lock().unwrap(),
+ 1,
+ "InboundTurnCompleted not published once"
+ );
}
#[test]