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

Function test_get_node_field

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

Source from the content-addressed store, hash-verified

733
734 #[test]
735 fn test_get_node_field() {
736 let node = KgNode::new("x", Class::WorkIntent, "PIMO-1", "vault")
737 .with_summary("Fix auth")
738 .with_metadata(serde_json::json!({"status": "in-progress", "priority": "high"}));
739
740 assert_eq!(
741 get_node_field(&node, "type"),
742 Some(Class::WorkIntent.iri().to_string())
743 );
744 assert_eq!(get_node_field(&node, "label"), Some("PIMO-1".to_string()));
745 assert_eq!(
746 get_node_field(&node, "summary"),
747 Some("Fix auth".to_string())
748 );
749 assert_eq!(get_node_field(&node, "id"), Some("x".to_string()));
750 assert_eq!(get_node_field(&node, "source"), Some("vault".to_string()));
751 assert_eq!(
752 get_node_field(&node, "status"),
753 Some("in-progress".to_string())
754 );
755 assert_eq!(get_node_field(&node, "priority"), Some("high".to_string()));
756 assert_eq!(get_node_field(&node, "nonexistent"), None);
757 }
758
759 #[test]
760 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