OpenTestDB opens the database connection to a test database without initializing any schema
(t *testing.T, dnoteDir string)
| 110 | // OpenTestDB opens the database connection to a test database |
| 111 | // without initializing any schema |
| 112 | func OpenTestDB(t *testing.T, dnoteDir string) *DB { |
| 113 | dbPath := fmt.Sprintf("%s/%s/%s", dnoteDir, consts.DnoteDirName, consts.DnoteDBFileName) |
| 114 | db, err := Open(dbPath) |
| 115 | if err != nil { |
| 116 | t.Fatal(errors.Wrap(err, "opening database connection to the test database")) |
| 117 | } |
| 118 | |
| 119 | return db |
| 120 | } |
| 121 | |
| 122 | // mustGenerateTestUUID generates a UUID for test databases and fails the test on error |
| 123 | func mustGenerateTestUUID(t *testing.T) string { |