neoneo-go/pkg/core/storage/boltdb_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

16 lines
324 B
Go

package storage
import (
"path"
"testing"
"github.com/stretchr/testify/require"
)
func newBoltStoreForTesting(t *testing.T) Store {
d := t.TempDir()
testFileName := path.Join(d, "test_bolt_db")
boltDBStore, err := NewBoltDBStore(BoltDBOptions{FilePath: testFileName})
require.NoError(t, err)
return boltDBStore
}