sk_gm_server/test/api_user_test.go

61 lines
1.1 KiB
Go
Raw Normal View History

2023-03-20 13:38:28 +08:00
package main
import (
"github.com/gogf/gf/net/ghttp"
"testing"
)
func TestUserGet(t *testing.T) {
if r, e := ghttp.Get(TestURL + "/system/user/get?id=1"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
func TestUserInsert(t *testing.T) {
if r, e := ghttp.Get(TestURL + "/system/user/access?name=john&age=18"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
func TestUserUpdate(t *testing.T) {
if r, e := ghttp.Get(TestURL + "/system/user/cache"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
func TestUserDelete(t *testing.T) {
if r, e := ghttp.Post(TestURL+"/system/user/access", "name=john&age=18"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
func TestUserList(t *testing.T) {
if r, e := ghttp.Get(TestURL + "/system/user/mysql"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}
func TestUserPage(t *testing.T) {
if r, e := ghttp.Get(TestURL + "/system/user/mysql"); e != nil {
t.Error(e)
} else {
t.Log(string(r.ReadAll()))
r.Close()
}
}