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

Function NewDB

test/testdb/database.go:40–45  ·  view source on GitHub ↗

NewDB creates a new test db instance.

(t *testing.T)

Source from the content-addressed store, hash-verified

38
39// NewDB creates a new test db instance.
40func NewDB(t *testing.T) *Database {
41 db, err := database.New("sqlite3", fmt.Sprintf("file:%s?mode=memory&cache=shared", fmt.Sprint(time.Now().UnixNano())), "admin", "pw", 5, false)
42 assert.Nil(t, err)
43 assert.NotNil(t, db)
44 return &Database{GormDatabase: db, t: t}
45}
46
47// User creates a user and returns a builder for applications and clients.
48func (d *Database) User(id uint) *AppClientBuilder {

Callers 8

SetupSuiteMethod · 0.92
BeforeTestMethod · 0.92
BeforeTestMethod · 0.92
BeforeTestMethod · 0.92
BeforeTestMethod · 0.92
BeforeTestMethod · 0.92
BeforeTestMethod · 0.92
BeforeTestMethod · 0.92

Calls 1

NewFunction · 0.92

Tested by 8

SetupSuiteMethod · 0.74
BeforeTestMethod · 0.74
BeforeTestMethod · 0.74
BeforeTestMethod · 0.74
BeforeTestMethod · 0.74
BeforeTestMethod · 0.74
BeforeTestMethod · 0.74
BeforeTestMethod · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…