mirror of
https://gitee.com/johng/gf.git
synced 2024-12-03 04:37:49 +08:00
unit test cases update for package gins
This commit is contained in:
parent
218c692fe0
commit
281bae4116
@ -56,6 +56,7 @@ test = "v=1"
|
||||
err := gfile.PutContents(path, config)
|
||||
gtest.Assert(err, nil)
|
||||
defer gfile.Remove(path)
|
||||
defer gins.Config().Reload()
|
||||
gtest.Assert(gins.Config().Get("test"), "v=1")
|
||||
gtest.Assert(gins.Config().Get("database.default.1.host"), "127.0.0.1")
|
||||
gtest.Assert(gins.Config().Get("redis.disk"), "127.0.0.1:6379,0")
|
||||
@ -65,6 +66,7 @@ test = "v=1"
|
||||
err := gfile.PutContents(path, config)
|
||||
gtest.Assert(err, nil)
|
||||
defer gfile.Remove(path)
|
||||
defer gins.Config().Reload()
|
||||
gtest.Assert(gins.Config("test.toml").Get("test"), "v=1")
|
||||
gtest.Assert(gins.Config("test.toml").Get("database.default.1.host"), "127.0.0.1")
|
||||
gtest.Assert(gins.Config("test.toml").Get("redis.disk"), "127.0.0.1:6379,0")
|
||||
@ -76,6 +78,7 @@ test = "v=1"
|
||||
err := gfile.PutContents(file, config)
|
||||
gtest.Assert(err, nil)
|
||||
defer gfile.Remove(file)
|
||||
defer gins.Config().Reload()
|
||||
gtest.Assert(gins.Config().AddPath(path), nil)
|
||||
gtest.Assert(gins.Config().Get("test"), "v=1")
|
||||
gtest.Assert(gins.Config().Get("database.default.1.host"), "127.0.0.1")
|
||||
@ -87,6 +90,7 @@ test = "v=1"
|
||||
err := gfile.PutContents(file, config)
|
||||
gtest.Assert(err, nil)
|
||||
defer gfile.Remove(file)
|
||||
defer gins.Config("test.toml").Reload()
|
||||
gtest.Assert(gins.Config("test.toml").AddPath(path), nil)
|
||||
gtest.Assert(gins.Config("test.toml").Get("test"), "v=1")
|
||||
gtest.Assert(gins.Config("test.toml").Get("database.default.1.host"), "127.0.0.1")
|
||||
|
@ -51,6 +51,7 @@ test = "v=1"
|
||||
err := gfile.PutContents(path, config)
|
||||
gtest.Assert(err, nil)
|
||||
defer gfile.Remove(path)
|
||||
defer gins.Config().Reload()
|
||||
|
||||
gtest.Case(t, func() {
|
||||
dbDefault := gins.Database()
|
||||
|
@ -51,6 +51,7 @@ test = "v=1"
|
||||
err := gfile.PutContents(path, config)
|
||||
gtest.Assert(err, nil)
|
||||
defer gfile.Remove(path)
|
||||
defer gins.Config().Reload()
|
||||
|
||||
gtest.Case(t, func() {
|
||||
redisDefault := gins.Redis()
|
||||
|
@ -1,3 +1,3 @@
|
||||
// from golang-1.11.2
|
||||
// from golang-1.11.2 text/template
|
||||
// 1. remove "<no value>" when template variable does not exist;
|
||||
package text
|
||||
|
Loading…
Reference in New Issue
Block a user