Skip to content

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

test(storage): update document assertions to new field names

Steven Enamakel2c6acf055f41
diff --git a/crates/openhuman-core/src/modules/storage_host_bus_tests.rs b/crates/openhuman-core/src/modules/storage_host_bus_tests.rs
index a9696c2b5b..2b29927dc8 100644
--- a/crates/openhuman-core/src/modules/storage_host_bus_tests.rs
+++ b/crates/openhuman-core/src/modules/storage_host_bus_tests.rs
@@ -163,7 +163,7 @@ async fn the_bus_hands_the_host_the_brokers_sender_and_nothing_else() {
.call("Get", get("notes", "a"))
.await
.unwrap();
- assert_eq!(found["document_id"], "a");
+ assert_eq!(found["id"], "a");
// ...a peer that is not a module is refused with the denial name, not data.
let refused = documents(&outsider)
diff --git a/crates/openhuman-core/src/modules/storage_host_linked_tests.rs b/crates/openhuman-core/src/modules/storage_host_linked_tests.rs
index c24755db2e..03bed53041 100644
--- a/crates/openhuman-core/src/modules/storage_host_linked_tests.rs
+++ b/crates/openhuman-core/src/modules/storage_host_linked_tests.rs
@@ -181,7 +181,7 @@ async fn servers_and_env_secrets_survive_a_restart_of_the_bus_and_host() {
// a core restart does.
let second = boot(backend).await;
let server = second.server("io.example/files").await.unwrap();
- assert_eq!(server["document_id"], "io.example/files");
+ assert_eq!(server["id"], "io.example/files");
assert_eq!(
second
.secret("mcp_client_env/io.example/files")
diff --git a/crates/openhuman-core/src/modules/storage_host_tests.rs b/crates/openhuman-core/src/modules/storage_host_tests.rs
index c3ec51d439..4bb6e94ab4 100644
--- a/crates/openhuman-core/src/modules/storage_host_tests.rs
+++ b/crates/openhuman-core/src/modules/storage_host_tests.rs
@@ -192,8 +192,8 @@ async fn a_module_stores_and_reads_its_own_documents() {
let found = call(&rig, &alpha(), Object::Documents, "Get", get("notes", "a"))
.await
.unwrap();
- assert_eq!(found["document_id"], "a");
- assert_eq!(found["document_json"], json!({"v": 1}).to_string());
+ assert_eq!(found["id"], "a");
+ assert_eq!(found["doc"], json!({"v": 1}));
}
#[tokio::test]
@@ -276,7 +276,7 @@ async fn a_module_cannot_name_another_modules_collection() {
let kept = call(&rig, &alpha(), Object::Documents, "Get", get("notes", "a"))
.await
.unwrap();
- assert_eq!(kept["document_json"], json!({"v": 1}).to_string());
+ assert_eq!(kept["doc"], json!({"v": 1}));
}
#[tokio::test]
@@ -323,10 +323,7 @@ async fn two_modules_granted_the_same_collection_name_do_not_share_documents() {
.await
.unwrap();
let alphas = ask(alpha(), "Get", get("notes", "a")).await.unwrap();
- assert_eq!(
- alphas["document_json"],
- json!({"owner": "alpha"}).to_string()
- );
+ assert_eq!(alphas["doc"], json!({"owner": "alpha"}));
}
#[tokio::test]
@@ -351,7 +348,7 @@ async fn a_module_in_another_scope_does_not_see_the_data() {
let back = call(&rig, &alpha(), Object::Documents, "Get", get("notes", "a"))
.await
.unwrap();
- assert_eq!(back["document_id"], "a");
+ assert_eq!(back["id"], "a");
}
#[tokio::test]