MCPcopy Index your code
hub / github.com/gopherdata/gophernotes / getMsgContentAsJSONObject

Function getMsgContentAsJSONObject

kernel_test.go:554–563  ·  view source on GitHub ↗

getMsgContentAsJSONObject is a test helper that fails the rest if the message content is not a map[string]interface{} and returns the content as a map[string]interface{} if it is of the correct type.

(t *testing.T, msg ComposedMsg)

Source from the content-addressed store, hash-verified

552// getMsgContentAsJSONObject is a test helper that fails the rest if the message content is not a
553// map[string]interface{} and returns the content as a map[string]interface{} if it is of the correct type.
554func getMsgContentAsJSONObject(t *testing.T, msg ComposedMsg) map[string]interface{} {
555 t.Helper()
556
557 content, ok := msg.Content.(map[string]interface{})
558 if !ok {
559 t.Fatalf("\t%s Message content is not a JSON object", failure)
560 }
561
562 return content
563}
564
565// getString is a test helper that retrieves a value as a string from the content at the given key. If the key
566// does not exist in the content map or the value is not a string this will fail the test. The jsonObjectName

Callers 4

testEvaluateFunction · 0.85
performJupyterRequestMethod · 0.85
executeCodeMethod · 0.85
testOutputStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected