api_log_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package main
  2. //
  3. //import (
  4. // "github.com/gogf/gf/net/ghttp"
  5. // "testing"
  6. //)
  7. //
  8. const (
  9. TestURL string = "http://127.0.0.1:80"
  10. )
  11. //
  12. //func TestLogTest(t *testing.T) {
  13. // if r, e := ghttp.Get(TestURL + "/tmp/test?name=john&age=18"); e != nil {
  14. // t.Error(e)
  15. // } else {
  16. // t.Log(string(r.ReadAll()))
  17. // r.Close()
  18. // }
  19. //}
  20. //
  21. //func TestLogPost(t *testing.T) {
  22. // if r, e := ghttp.Post(TestURL+"/tmp/access", "name=john&age=18"); e != nil {
  23. // t.Error(e)
  24. // } else {
  25. // t.Log(string(r.ReadAll()))
  26. // r.Close()
  27. // }
  28. //}
  29. //
  30. //func TestLogGet(t *testing.T) {
  31. // if r, e := ghttp.Get(TestURL + "/tmp/access?name=john&age=18"); e != nil {
  32. // t.Error(e)
  33. // } else {
  34. // t.Log(string(r.ReadAll()))
  35. // r.Close()
  36. // }
  37. //}
  38. //
  39. //func TestLogCache(t *testing.T) {
  40. // if r, e := ghttp.Get(TestURL + "/tmp/cache"); e != nil {
  41. // t.Error(e)
  42. // } else {
  43. // t.Log(string(r.ReadAll()))
  44. // r.Close()
  45. // }
  46. //}
  47. //
  48. //func TestLogMysql(t *testing.T) {
  49. // if r, e := ghttp.Get(TestURL + "/tmp/mysql"); e != nil {
  50. // t.Error(e)
  51. // } else {
  52. // t.Log(string(r.ReadAll()))
  53. // r.Close()
  54. // }
  55. //}