functest_test.go 713 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package postgre
  2. import (
  3. "sportfitness/base/assembly/base/repository"
  4. "sportfitness/base/errors"
  5. "testing"
  6. "git.beswell.com/gframe/application"
  7. )
  8. func init() {
  9. application.NewDefault()
  10. repository.Init()
  11. Init()
  12. }
  13. func TestAdd(t *testing.T) {
  14. err := FuncTest{}.TestAdd(1, "{\"user_name\":\"王一\", \"usercode\": \"wang1\", \"shopid\": 1}", "XX")
  15. println(err)
  16. }
  17. func TestQuery32(t *testing.T) {
  18. str, err := FuncTest{}.TestQuery32(1, "{\"user_name\": \"王\"}", "XX")
  19. //if err != nil{
  20. // e := errors.PGError
  21. // errJson, e_ := json.Marshal(e)
  22. //
  23. // if e_ != nil {
  24. // println(e_)
  25. // }
  26. // ej := string(errJson)
  27. // println(ej)
  28. //}
  29. if err != nil {
  30. panic(errors.PGError)
  31. }
  32. println(str)
  33. }