Compare commits
1 Commits
5690dc39f4
...
e651e672aa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e651e672aa |
@@ -2,27 +2,11 @@ package imgcache
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"sneak.berlin/go/pixa/internal/database"
|
||||
)
|
||||
|
||||
func setupTestDB(t *testing.T) *sql.DB {
|
||||
t.Helper()
|
||||
db, err := sql.Open("sqlite", ":memory:")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := database.ApplyMigrations(db); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Cleanup(func() { db.Close() })
|
||||
return db
|
||||
}
|
||||
|
||||
func TestNegativeCache_StoreAndCheck(t *testing.T) {
|
||||
db := setupTestDB(t)
|
||||
dir := t.TempDir()
|
||||
|
||||
Reference in New Issue
Block a user