Add bunt db testing.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-09-19 21:52:40 +08:00
parent 9b5815fd9f
commit f24c65a9fa
5 changed files with 63 additions and 12 deletions

View File

@@ -150,11 +150,11 @@ func BuildDefaultPushConf() ConfYaml {
conf.Stat.Redis.Password = ""
conf.Stat.Redis.DB = 0
conf.Stat.BoltDB.Path = "gorush.db"
conf.Stat.BoltDB.Path = "bolt.db"
conf.Stat.BoltDB.Bucket = "gorush"
conf.Stat.BuntDB.Path = "gorush.db"
conf.Stat.LevelDB.Path = "gorush.db"
conf.Stat.BuntDB.Path = "bunt.db"
conf.Stat.LevelDB.Path = "level.db"
return conf
}

View File

@@ -45,9 +45,9 @@ stat:
password: ""
db: 0
boltdb:
path: "gorush.db"
path: "bolt.db"
bucket: "gorush"
buntdb:
path: "gorush.db"
path: "bunt.db"
leveldb:
path: "gorush.db"
path: "level.db"

View File

@@ -98,11 +98,11 @@ func (suite *ConfigTestSuite) TestValidateConfDefault() {
assert.Equal(suite.T(), "", suite.ConfGorushDefault.Stat.Redis.Password)
assert.Equal(suite.T(), 0, suite.ConfGorushDefault.Stat.Redis.DB)
assert.Equal(suite.T(), "gorush.db", suite.ConfGorushDefault.Stat.BoltDB.Path)
assert.Equal(suite.T(), "bolt.db", suite.ConfGorushDefault.Stat.BoltDB.Path)
assert.Equal(suite.T(), "gorush", suite.ConfGorushDefault.Stat.BoltDB.Bucket)
assert.Equal(suite.T(), "gorush.db", suite.ConfGorushDefault.Stat.BuntDB.Path)
assert.Equal(suite.T(), "gorush.db", suite.ConfGorushDefault.Stat.LevelDB.Path)
assert.Equal(suite.T(), "bunt.db", suite.ConfGorushDefault.Stat.BuntDB.Path)
assert.Equal(suite.T(), "level.db", suite.ConfGorushDefault.Stat.LevelDB.Path)
}
func (suite *ConfigTestSuite) TestValidateConf() {
@@ -151,11 +151,11 @@ func (suite *ConfigTestSuite) TestValidateConf() {
assert.Equal(suite.T(), "", suite.ConfGorush.Stat.Redis.Password)
assert.Equal(suite.T(), 0, suite.ConfGorush.Stat.Redis.DB)
assert.Equal(suite.T(), "gorush.db", suite.ConfGorush.Stat.BoltDB.Path)
assert.Equal(suite.T(), "bolt.db", suite.ConfGorush.Stat.BoltDB.Path)
assert.Equal(suite.T(), "gorush", suite.ConfGorush.Stat.BoltDB.Bucket)
assert.Equal(suite.T(), "gorush.db", suite.ConfGorush.Stat.BuntDB.Path)
assert.Equal(suite.T(), "gorush.db", suite.ConfGorush.Stat.LevelDB.Path)
assert.Equal(suite.T(), "bunt.db", suite.ConfGorush.Stat.BuntDB.Path)
assert.Equal(suite.T(), "level.db", suite.ConfGorush.Stat.LevelDB.Path)
}
func TestConfigTestSuite(t *testing.T) {