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

Method BeforeTest

api/client_test.go:38–48  ·  view source on GitHub ↗
(suiteName, testName string)

Source from the content-addressed store, hash-verified

36var originalGenerateClientToken func() string
37
38func (s *ClientSuite) BeforeTest(suiteName, testName string) {
39 originalGenerateClientToken = generateClientToken
40 generateClientToken = test.Tokens(firstClientToken, secondClientToken)
41 mode.Set(mode.TestDev)
42 s.recorder = httptest.NewRecorder()
43 s.db = testdb.NewDB(s.T())
44 s.ctx, _ = gin.CreateTestContext(s.recorder)
45 withURL(s.ctx, "http", "example.com")
46 s.notified = false
47 s.a = &ClientAPI{DB: s.db, NotifyDeleted: s.notify}
48}
49
50func (s *ClientSuite) notify(uint, string) {
51 s.notified = true

Callers

nothing calls this directly

Calls 4

TokensFunction · 0.92
SetFunction · 0.92
NewDBFunction · 0.92
withURLFunction · 0.70

Tested by

no test coverage detected