Torjus Håkestad
d4b7702bad
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
28 lines
482 B
Go
28 lines
482 B
Go
package users_test
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"git.t-juice.club/torjus/gpaste/users"
|
|
)
|
|
|
|
func TestBoltUserStore(t *testing.T) {
|
|
tmpDir := t.TempDir()
|
|
newFunc := func() (func(), users.UserStore) {
|
|
tmpFile := filepath.Join(tmpDir, randomString(8))
|
|
|
|
store, err := users.NewBoltUserStore(tmpFile)
|
|
if err != nil {
|
|
t.Fatalf("Error creating store: %s", err)
|
|
}
|
|
cleanup := func() {
|
|
store.Close()
|
|
}
|
|
return cleanup, store
|
|
}
|
|
|
|
RunUserStoreTest(newFunc, t)
|
|
|
|
}
|