MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / test_serialize_error_response

Function test_serialize_error_response

src/mcp/transport.rs:328–339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

326
327 #[test]
328 fn test_serialize_error_response() {
329 let response = JsonRpcResponse::error(
330 serde_json::Value::Number(1.into()),
331 ErrorCode::MethodNotFound,
332 "Method not found".to_string(),
333 );
334
335 let json = serde_json::to_string(&response).unwrap();
336 assert!(json.contains("-32601"));
337 assert!(json.contains("Method not found"));
338 assert!(!json.contains("\"result\""));
339 }
340
341 #[test]
342 fn test_error_codes() {

Callers

nothing calls this directly

Calls 1

errorFunction · 0.85

Tested by

no test coverage detected