ezshare/store/bolt_test.go
Torjus Håkestad fd729eef89
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Rename module
2022-01-13 18:40:15 +01:00

49 lines
1.0 KiB
Go

//nolint:staticcheck
package store_test
import (
"path/filepath"
"testing"
"git.t-juice.club/torjus/ezshare/store"
)
func TestBoltStore(t *testing.T) {
path := filepath.Join(t.TempDir(), "boltstore.db")
s, err := store.NewBoltStore(path)
defer s.Close()
if err != nil {
t.Fatalf("Error opening store: %s", err)
}
doFileStoreTest(s, t)
}
func TestBoltCertificateStore(t *testing.T) {
path := filepath.Join(t.TempDir(), "boltstore.db")
s, err := store.NewBoltStore(path)
defer s.Close()
if err != nil {
t.Fatalf("Error opening store: %s", err)
}
doCertificateStoreTest(s, t)
}
func TestBoltUserStore(t *testing.T) {
path := filepath.Join(t.TempDir(), "boltstore.db")
s, err := store.NewBoltStore(path)
defer s.Close()
if err != nil {
t.Fatalf("Error opening store: %s", err)
}
doUserStoreTests(s, t)
}
func TestBoltBinaryStore(t *testing.T) {
path := filepath.Join(t.TempDir(), "boltstore.db")
s, err := store.NewBoltStore(path)
defer s.Close()
if err != nil {
t.Fatalf("Error opening store: %s", err)
}
doBinaryStoreTests(s, t)
}