MCPcopy Index your code
hub / github.com/gotify/server / Test_RemoveAppImage_expectSuccess

Method Test_RemoveAppImage_expectSuccess

api/application_test.go:500–516  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

498}
499
500func (s *ApplicationSuite) Test_RemoveAppImage_expectSuccess() {
501 s.db.User(5)
502
503 imageFile := "existing.png"
504 s.db.CreateApplication(&model.Application{UserID: 5, ID: 1, Image: imageFile})
505 fakeImage(s.T(), imageFile)
506
507 test.WithUser(s.ctx, 5)
508 s.ctx.Request = httptest.NewRequest("DELETE", "/irrelevant", nil)
509 s.ctx.Params = gin.Params{{Key: "id", Value: "1"}}
510 s.a.RemoveApplicationImage(s.ctx)
511
512 _, err := os.Stat(imageFile)
513 assert.True(s.T(), os.IsNotExist(err))
514
515 assert.Equal(s.T(), 200, s.recorder.Code)
516}
517
518func (s *ApplicationSuite) Test_UpdateApplicationNameAndDescription_expectSuccess() {
519 s.db.User(5).NewAppWithToken(2, "app-2")

Callers

nothing calls this directly

Calls 5

WithUserFunction · 0.92
fakeImageFunction · 0.85
UserMethod · 0.80
CreateApplicationMethod · 0.65

Tested by

no test coverage detected