| 64 | } |
| 65 | |
| 66 | func 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 | |
| 77 | func 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) |