fix(store): remove default db file name

This commit is contained in:
hexxa 2022-01-29 14:04:52 +08:00 committed by Hexxa
parent 4dcb487c85
commit 8190c6c204
3 changed files with 9 additions and 3 deletions

View file

@ -3,6 +3,7 @@ package fileinfostore
import ( import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath"
"testing" "testing"
"github.com/ihexxa/quickshare/src/kvstore/boltdbpvd" "github.com/ihexxa/quickshare/src/kvstore/boltdbpvd"
@ -151,7 +152,8 @@ func TestUserStores(t *testing.T) {
} }
defer os.RemoveAll(rootPath) defer os.RemoveAll(rootPath)
kvstore := boltdbpvd.New(rootPath, 1024) dbPath := filepath.Join(rootPath, "quickshare.db")
kvstore := boltdbpvd.New(dbPath, 1024)
defer kvstore.Close() defer kvstore.Close()
store, err := NewFileInfoStore(kvstore) store, err := NewFileInfoStore(kvstore)

View file

@ -3,6 +3,7 @@ package sitestore
import ( import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath"
"reflect" "reflect"
"testing" "testing"
@ -44,7 +45,8 @@ func TestSiteStore(t *testing.T) {
} }
defer os.RemoveAll(rootPath) defer os.RemoveAll(rootPath)
kvstore := boltdbpvd.New(rootPath, 1024) dbPath := filepath.Join(rootPath, "quickshare.db")
kvstore := boltdbpvd.New(dbPath, 1024)
defer kvstore.Close() defer kvstore.Close()
store, err := NewSiteStore(kvstore) store, err := NewSiteStore(kvstore)

View file

@ -3,6 +3,7 @@ package userstore
import ( import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath"
"strings" "strings"
"testing" "testing"
@ -276,7 +277,8 @@ func TestUserStores(t *testing.T) {
} }
defer os.RemoveAll(rootPath) defer os.RemoveAll(rootPath)
kvstore := boltdbpvd.New(rootPath, 1024) dbPath := filepath.Join(rootPath, "quickshare.db")
kvstore := boltdbpvd.New(dbPath, 1024)
defer kvstore.Close() defer kvstore.Close()
store, err := NewKVUserStore(kvstore) store, err := NewKVUserStore(kvstore)