created neo4j+boltdb dev environment harness
This commit is contained in:
+5
-5
@@ -8,7 +8,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func tempDB(t *testing.T) *bolt.DB {
|
||||
func newBoltStore(t *testing.T) *bolt.DB {
|
||||
path := filepath.Join(t.TempDir(), "test.db")
|
||||
db, err := bolt.Open(path, 0600, nil)
|
||||
require.NoError(t, err)
|
||||
@@ -17,7 +17,7 @@ func tempDB(t *testing.T) *bolt.DB {
|
||||
}
|
||||
|
||||
func TestSetupBoltDB(t *testing.T) {
|
||||
db := tempDB(t)
|
||||
db := newBoltStore(t)
|
||||
|
||||
err := SetupBoltDB(db)
|
||||
assert.NoError(t, err)
|
||||
@@ -89,7 +89,7 @@ func TestBatchCheckEventsExist(t *testing.T) {
|
||||
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
db := tempDB(t)
|
||||
db := newBoltStore(t)
|
||||
|
||||
if !tc.skipSetup {
|
||||
err := SetupBoltDB(db)
|
||||
@@ -149,7 +149,7 @@ func TestBatchWriteEvents(t *testing.T) {
|
||||
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
db := tempDB(t)
|
||||
db := newBoltStore(t)
|
||||
|
||||
err := SetupBoltDB(db)
|
||||
require.NoError(t, err)
|
||||
@@ -171,7 +171,7 @@ func TestBatchWriteEvents(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWriteThenCheck(t *testing.T) {
|
||||
db := tempDB(t)
|
||||
db := newBoltStore(t)
|
||||
|
||||
err := SetupBoltDB(db)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user