neoneo-go/pkg/core/storage/badgerdb_store_test.go
Roman Khimov 6d074a96e9 *: make tests use TempDir(), fix #1319
Simplify things, drop TempFile at the same time (refs. #1764)
2021-08-26 17:29:40 +03:00

20 lines
401 B
Go

package storage
import (
"testing"
"github.com/stretchr/testify/require"
)
func newBadgerDBForTesting(t *testing.T) Store {
bdbDir := t.TempDir()
dbConfig := DBConfiguration{
Type: "badgerdb",
BadgerDBOptions: BadgerDBOptions{
Dir: bdbDir,
},
}
newBadgerStore, err := NewBadgerDBStore(dbConfig.BadgerDBOptions)
require.Nil(t, err, "NewBadgerDBStore error")
return newBadgerStore
}