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

Function json_payload_serializes

atomic-cli/src/commands/agent/status.rs:735–745  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

733 /// exists — and `to_string` is called with `expect` in the command.
734 #[test]
735 fn json_payload_serializes() {
736 let dir = temp_repo();
737 let out = json_cmd().to_json(dir.path(), &AgentRegistry::with_defaults());
738 let text = serde_json::to_string(&out).expect("serializes");
739
740 let parsed: serde_json::Value = serde_json::from_str(&text).unwrap();
741 assert!(parsed["agents"].is_array());
742 assert!(parsed["totals"]["sessions"].is_number());
743 // Absent rather than null, so consumers can test for presence.
744 assert!(parsed.get("sessions_error").is_none());
745 }
746
747 #[test]
748 fn test_session_store_for_temp_repo() {

Callers

nothing calls this directly

Calls 5

temp_repoFunction · 0.85
json_cmdFunction · 0.85
to_jsonMethod · 0.45
pathMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected