MCPcopy
hub / github.com/gotify/server / Test_GetConfig_incorrectUser_expectNotFound

Method Test_GetConfig_incorrectUser_expectNotFound

api/plugin_test.go:421–434  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

419}
420
421func (s *PluginSuite) Test_GetConfig_incorrectUser_expectNotFound() {
422 conf, err := s.db.GetPluginConfByUserAndPath(1, mock.ModulePath)
423 assert.NoError(s.T(), err)
424
425 {
426 test.WithUser(s.ctx, 2)
427
428 s.ctx.Request = httptest.NewRequest("GET", fmt.Sprintf("/plugin/%d/config", conf.ID), nil)
429 s.ctx.Params = gin.Params{{Key: "id", Value: fmt.Sprint(conf.ID)}}
430 s.a.GetConfig(s.ctx)
431
432 assert.Equal(s.T(), 404, s.recorder.Code)
433 }
434}
435
436func (s *PluginSuite) Test_GetConfig_danglingConf_expectNotFound() {
437 conf := s.getDanglingConf(1)

Callers

nothing calls this directly

Calls 3

WithUserFunction · 0.92
GetConfigMethod · 0.80

Tested by

no test coverage detected