unit test cases update for package gins

This commit is contained in:
John
2019-03-14 00:23:46 +08:00
parent 3411bd1c1d
commit 45a83fc53c
2 changed files with 8 additions and 2 deletions

View File

@ -7,6 +7,7 @@
package gins_test
import (
"fmt"
"github.com/gogf/gf/g/frame/gins"
"github.com/gogf/gf/g/os/gfile"
"github.com/gogf/gf/g/test/gtest"
@ -17,7 +18,7 @@ func Test_Database(t *testing.T) {
config := `
# 模板引擎目录
viewpath = "/home/www/templates/"
test = "v=1"
test = "v=2"
# MySQL数据库配置
[database]
[[database.default]]
@ -54,6 +55,8 @@ test = "v=1"
defer gins.Config().Reload()
gtest.Case(t, func() {
fmt.Println("gins Test_Database", gins.Config().Get("test"))
dbDefault := gins.Database()
dbTest := gins.Database("test")
gtest.AssertNE(dbDefault, nil)

View File

@ -7,6 +7,7 @@
package gins_test
import (
"fmt"
"github.com/gogf/gf/g/frame/gins"
"github.com/gogf/gf/g/os/gfile"
"github.com/gogf/gf/g/test/gtest"
@ -17,7 +18,7 @@ func Test_Redis(t *testing.T) {
config := `
# 模板引擎目录
viewpath = "/home/www/templates/"
test = "v=1"
test = "v=3"
# MySQL数据库配置
[database]
[[database.default]]
@ -54,6 +55,8 @@ test = "v=1"
defer gins.Config().Reload()
gtest.Case(t, func() {
fmt.Println("gins Test_Redis", gins.Config().Get("test"))
redisDefault := gins.Redis()
redisCache := gins.Redis("cache")
gtest.AssertNE(redisDefault, nil)