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

Function test_envelope_encodes_successfully

atomic-agent/src/record/tests.rs:867–881  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

865
866#[test]
867fn test_envelope_encodes_successfully() {
868 let session = make_session();
869 let event = make_event();
870 let options = make_options(&session, &event);
871 let files = vec!["src/auth.rs".to_string()];
872
873 let env = build_turn_envelope(&options, &files);
874 let bytes = env.encode().unwrap();
875 assert!(SessionEnvelope::is_session_envelope(&bytes));
876
877 // Roundtrip
878 let decoded = SessionEnvelope::decode(&bytes).unwrap();
879 assert_eq!(decoded.session_id, "sess-test-123");
880 assert_eq!(decoded.turn_number, 3);
881}
882
883// record_turn tests (error cases — success requires a real repository)
884

Callers

nothing calls this directly

Calls 7

make_eventFunction · 0.85
make_optionsFunction · 0.85
build_turn_envelopeFunction · 0.85
make_sessionFunction · 0.70
decodeFunction · 0.50
unwrapMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected