MCPcopy
hub / github.com/netdata/netdata / TestCmdAdd_ParseError

Function TestCmdAdd_ParseError

src/go/plugin/framework/dyncfg/handler_test.go:520–531  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

518}
519
520func TestCmdAdd_ParseError(t *testing.T) {
521 cb := &mockCallbacks{}
522 cb.parseAndValidateFn = func(_ Function, _ string) (testConfig, error) {
523 return testConfig{}, errors.New("bad config")
524 }
525 h := newTestHandler(cb)
526
527 fn := newTestFn("test:job1", "add", "job1", []byte(`{}`))
528 h.CmdAdd(fn)
529
530 assert.Equal(t, 0, h.exposed.Count())
531}
532
533func TestCmdAdd_ReplacesExisting(t *testing.T) {
534 cb := &mockCallbacks{}

Callers

nothing calls this directly

Calls 6

newTestHandlerFunction · 0.85
newTestFnFunction · 0.85
CmdAddMethod · 0.80
EqualMethod · 0.80
NewMethod · 0.65
CountMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…