neoneo-go/pkg/core/storage/leveldb_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
406 B
Go

package storage
import (
"testing"
"github.com/stretchr/testify/require"
)
func newLevelDBForTesting(t *testing.T) Store {
ldbDir := t.TempDir()
dbConfig := DBConfiguration{
Type: "leveldb",
LevelDBOptions: LevelDBOptions{
DataDirectoryPath: ldbDir,
},
}
newLevelStore, err := NewLevelDBStore(dbConfig.LevelDBOptions)
require.Nil(t, err, "NewLevelDBStore error")
return newLevelStore
}