Use test config for TestConfig_Db and TestConfig_CloseDb
This commit is contained in:
parent
460712dff4
commit
c531c5aec9
1 changed files with 5 additions and 8 deletions
|
@ -312,21 +312,18 @@ func TestConfig_HttpStaticBuildPath(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestConfig_Db(t *testing.T) {
|
||||
ctx := CliTestContext()
|
||||
c := NewConfig(ctx)
|
||||
assert.Nil(t, c.Init(context.TODO()))
|
||||
c := NewTestConfig()
|
||||
|
||||
assert.NotNil(t, c.Db())
|
||||
}
|
||||
|
||||
func TestConfig_CloseDb(t *testing.T) {
|
||||
ctx := CliTestContext()
|
||||
c := NewConfig(ctx)
|
||||
assert.Nil(t, c.Init(context.TODO()))
|
||||
c := NewTestConfig()
|
||||
|
||||
assert.NotNil(t, c.Db())
|
||||
db := c.CloseDb()
|
||||
assert.Nil(t, db)
|
||||
|
||||
err := c.CloseDb()
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestConfig_ClientConfig(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue