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

Method Test_UpdateConfig_danglingConf_expectNotFound

api/plugin_test.go:660–679  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

658}
659
660func (s *PluginSuite) Test_UpdateConfig_danglingConf_expectNotFound() {
661 conf := s.getDanglingConf(1)
662
663 newConfig := &mock.PluginConfig{
664 TestKey: "test__new__config",
665 }
666 newConfigYAML, err := yaml.Marshal(newConfig)
667 assert.Nil(s.T(), err)
668
669 {
670 test.WithUser(s.ctx, 1)
671
672 s.ctx.Request = httptest.NewRequest("POST", fmt.Sprintf("/plugin/%d/config", conf.ID), bytes.NewReader(newConfigYAML))
673 s.ctx.Header("Content-Type", "application/x-yaml")
674 s.ctx.Params = gin.Params{{Key: "id", Value: fmt.Sprint(conf.ID)}}
675 s.a.UpdateConfig(s.ctx)
676
677 assert.Equal(s.T(), 404, s.recorder.Code)
678 }
679}
680
681func (s *PluginSuite) Test_UpdateConfig_nonExistPlugin_expectNotFound() {
682 newConfig := &mock.PluginConfig{

Callers

nothing calls this directly

Calls 3

getDanglingConfMethod · 0.95
WithUserFunction · 0.92
UpdateConfigMethod · 0.80

Tested by

no test coverage detected