remove db file before testing.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-08-02 16:25:04 +08:00
parent 601472a6db
commit 9dd33575e6
1 changed files with 5 additions and 0 deletions

View File

@ -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()