neoneo-go/pkg/core/storage/store_type_test.go
2022-10-07 15:56:34 +03:00

29 lines
675 B
Go

package storage
import (
"path/filepath"
"testing"
"github.com/nspcc-dev/neo-go/pkg/core/storage/dbconfig"
"github.com/stretchr/testify/require"
)
func TestStorageNames(t *testing.T) {
tmp := t.TempDir()
cfg := dbconfig.DBConfiguration{
LevelDBOptions: dbconfig.LevelDBOptions{
DataDirectoryPath: filepath.Join(tmp, "level"),
},
BoltDBOptions: dbconfig.BoltDBOptions{
FilePath: filepath.Join(tmp, "bolt"),
},
}
for _, name := range []string{dbconfig.BoltDB, dbconfig.LevelDB, dbconfig.InMemoryDB} {
t.Run(name, func(t *testing.T) {
cfg.Type = name
s, err := NewStore(cfg)
require.NoError(t, err)
require.NoError(t, s.Close())
})
}
}