remove db file before testing.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
601472a6db
commit
9dd33575e6
|
@ -3,6 +3,7 @@ package buntdb
|
|||
import (
|
||||
c "github.com/appleboy/gorush/config"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -11,6 +12,10 @@ func TestBuntDBEngine(t *testing.T) {
|
|||
|
||||
config := c.BuildDefaultPushConf()
|
||||
|
||||
if _, err := os.Stat(config.Stat.BuntDB.Path); os.IsNotExist(err) {
|
||||
os.RemoveAll(config.Stat.BuntDB.Path)
|
||||
}
|
||||
|
||||
buntDB := New(config)
|
||||
buntDB.Init()
|
||||
buntDB.Reset()
|
||||
|
|
Loading…
Reference in New Issue