MCPcopy Index your code
hub / github.com/netdata/netdata / TestFUNCRESULT

Function TestFUNCRESULT

src/go/pkg/netdataapi/api_test.go:242–259  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

240}
241
242func TestFUNCRESULT(t *testing.T) {
243 w := &bytes.Buffer{}
244 api := New(w)
245
246 result := FunctionResult{
247 UID: "test-uid",
248 ContentType: "text/plain",
249 Payload: "test payload",
250 Code: "200",
251 ExpireTimestamp: "1234567890",
252 }
253
254 api.FUNCRESULT(result)
255
256 expected := "FUNCTION_RESULT_BEGIN test-uid 200 text/plain 1234567890\ntest payload\nFUNCTION_RESULT_END\n\n"
257
258 require.Equal(t, expected, w.String())
259}
260
261func TestCONFIGCREATE(t *testing.T) {
262 w := &bytes.Buffer{}

Callers

nothing calls this directly

Calls 4

FUNCRESULTMethod · 0.80
EqualMethod · 0.80
NewFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…