MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_get_node_field

Function test_get_node_field

atomic-repository/src/query_plan.rs:642–661  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

640
641 #[test]
642 fn test_get_node_field() {
643 let node = KgNode::new("x", "intent", "PIMO-1", "vault")
644 .with_summary("Fix auth")
645 .with_metadata(serde_json::json!({"status": "in-progress", "priority": "high"}));
646
647 assert_eq!(get_node_field(&node, "kind"), Some("intent".to_string()));
648 assert_eq!(get_node_field(&node, "label"), Some("PIMO-1".to_string()));
649 assert_eq!(
650 get_node_field(&node, "summary"),
651 Some("Fix auth".to_string())
652 );
653 assert_eq!(get_node_field(&node, "id"), Some("x".to_string()));
654 assert_eq!(get_node_field(&node, "source"), Some("vault".to_string()));
655 assert_eq!(
656 get_node_field(&node, "status"),
657 Some("in-progress".to_string())
658 );
659 assert_eq!(get_node_field(&node, "priority"), Some("high".to_string()));
660 assert_eq!(get_node_field(&node, "nonexistent"), None);
661 }
662
663 #[test]
664 fn test_get_node_field_metadata_types() {

Callers

nothing calls this directly

Calls 2

with_summaryMethod · 0.80
with_metadataMethod · 0.45

Tested by

no test coverage detected