MCPcopy
hub / github.com/mattermost/mattermost / TestErrNotFound

Function TestErrNotFound

server/channels/store/errors_test.go:14–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestErrNotFound(t *testing.T) {
15 id := model.NewId()
16
17 t.Run("plain", func(t *testing.T) {
18 err := NewErrNotFound("channel", id)
19
20 assert.EqualError(t, err, "resource \"channel\" not found, id: "+id)
21 })
22 t.Run("with wrapped error", func(t *testing.T) {
23 err := NewErrNotFound("channel", id)
24 err = err.Wrap(errors.New("some error"))
25
26 assert.EqualError(t, err, "resource \"channel\" not found, id: "+id+", error: some error")
27 })
28}

Callers

nothing calls this directly

Calls 3

WrapMethod · 0.95
NewErrNotFoundFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…