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

Function TestPanicsOnMkdirError

database/database_test.go:66–75  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestPanicsOnMkdirError(t *testing.T) {
67 tmpDir := test.NewTmpDir("gotify_testpanicsonmkdirerror")
68 defer tmpDir.Clean()
69 mkdirAll = func(path string, perm os.FileMode) error {
70 return errors.New("ERROR")
71 }
72 assert.Panics(t, func() {
73 New("sqlite3", tmpDir.Path("somepath/test.db"), "defaultUser", "defaultPass", 5, true)
74 })
75}
76
77func TestMigrateSortKey(t *testing.T) {
78 db, err := New("sqlite3", fmt.Sprintf("file:%s?mode=memory&cache=shared", fmt.Sprint(time.Now().UnixNano())), "admin", "pw", 5, true)

Callers

nothing calls this directly

Calls 4

CleanMethod · 0.95
PathMethod · 0.95
NewTmpDirFunction · 0.92
NewFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…