MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / TestToJsonReq_Fail

Function TestToJsonReq_Fail

internal/request/request_test.go:42–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestToJsonReq_Fail(t *testing.T) {
43 // Payload with unsupported data type
44 payload := map[string]interface{}{
45 "key": make(chan int), // invalid data type for JSON encoding
46 }
47
48 reqBuffer, err := request.ToJsonReq(payload)
49 assert.Error(t, err)
50 assert.Nil(t, reqBuffer)
51}
52
53func TestCall_Success(t *testing.T) {
54 // Mock server to return a dummy response

Callers

nothing calls this directly

Calls 2

ToJsonReqFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected