gpaste/users/userstore_bolt_test.go
Torjus Håkestad d4b7702bad
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Create users package
2022-01-20 03:35:55 +01:00

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)
}