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 (
|
import (
|
||||||
c "github.com/appleboy/gorush/config"
|
c "github.com/appleboy/gorush/config"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -11,6 +12,10 @@ func TestBuntDBEngine(t *testing.T) {
|
||||||
|
|
||||||
config := c.BuildDefaultPushConf()
|
config := c.BuildDefaultPushConf()
|
||||||
|
|
||||||
|
if _, err := os.Stat(config.Stat.BuntDB.Path); os.IsNotExist(err) {
|
||||||
|
os.RemoveAll(config.Stat.BuntDB.Path)
|
||||||
|
}
|
||||||
|
|
||||||
buntDB := New(config)
|
buntDB := New(config)
|
||||||
buntDB.Init()
|
buntDB.Init()
|
||||||
buntDB.Reset()
|
buntDB.Reset()
|
||||||
|
|
Loading…
Reference in New Issue