1 Star 0 Fork 62

痛恨小朋友/gmanager

forked from goflyfox/gmanager 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
api_log_test.go 979 Bytes
一键复制 编辑 原始数据 按行查看 历史
zcool321@sina.com 提交于 2019-09-14 22:23 +08:00 . support gf v2.0.0
package main
import (
"github.com/gogf/gf/net/ghttp"
"testing"
)
const (
TestURL string = "http://127.0.0.1:80"
)
func TestLogTest(t *testing.T) {
if r, e := ghttp.Get(TestURL + "/tmp/test?name=john&age=18"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
func TestLogPost(t *testing.T) {
if r, e := ghttp.Post(TestURL+"/tmp/access", "name=john&age=18"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
func TestLogGet(t *testing.T) {
if r, e := ghttp.Get(TestURL + "/tmp/access?name=john&age=18"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
func TestLogCache(t *testing.T) {
if r, e := ghttp.Get(TestURL + "/tmp/cache"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
func TestLogMysql(t *testing.T) {
if r, e := ghttp.Get(TestURL + "/tmp/mysql"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/azuresoft/gmanager.git
git@gitee.com:azuresoft/gmanager.git
azuresoft
gmanager
gmanager
v0.1.0

搜索帮助

371d5123 14472233 46e8bd33 14472233