Skip to content

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

test(catalog_storage): assert correct value on delete

Steven Enamakel17b70e0c22f5
diff --git a/crates/openhuman-core/src/flows/catalog_storage_tests.rs b/crates/openhuman-core/src/flows/catalog_storage_tests.rs
index bf242393e5..aa833d13ca 100644
--- a/crates/openhuman-core/src/flows/catalog_storage_tests.rs
+++ b/crates/openhuman-core/src/flows/catalog_storage_tests.rs
@@ -388,7 +388,10 @@ async fn catalog_storage_resolves_the_current_backend_and_confines_graph_namespa
)
.await
.unwrap();
- assert!(matches!(delete, CatalogStorageReply::Value { .. }));
+ assert!(matches!(
+ delete,
+ CatalogStorageReply::Value { ref value } if value == &json!(2)
+ ));
let foreign = first
.documents()
.get("graph.threads", "other/bob-thread")
@@ -399,6 +402,23 @@ async fn catalog_storage_resolves_the_current_backend_and_confines_graph_namespa
"flow deletion leaves the other namespace intact"
);
+ let reinserted: CatalogStorageReply = proxy
+ .call(
+ catalog::storage::PUT,
+ &(DocPutRequest {
+ collection: "graph.threads".into(),
+ id: "flows/delete-me".into(),
+ doc: json!({"ns":"flows","thread":"delete-me","next":1}),
+ precondition: CatalogDocumentPrecondition::Absent,
+ schema: 0,
+ expires_ms: None,
+ created_ms: None,
+ },),
+ )
+ .await
+ .unwrap();
+ assert!(matches!(reinserted, CatalogStorageReply::Value { .. }));
+
let forbidden_get: CatalogStorageReply = proxy
.call(
catalog::storage::GET,