req_rpc_test.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoInfo3(t *testing.T) {
  8. var (
  9. c = context.Background()
  10. mid = int64(2)
  11. )
  12. convey.Convey("Info3", t, func(ctx convey.C) {
  13. res, err := d.Info3(c, mid)
  14. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  15. ctx.So(err, convey.ShouldBeNil)
  16. ctx.So(res, convey.ShouldNotBeNil)
  17. })
  18. })
  19. }
  20. func TestDaoInfos(t *testing.T) {
  21. var (
  22. c = context.Background()
  23. ipList = []string{"127.0.0.1"}
  24. )
  25. convey.Convey("Infos", t, func(ctx convey.C) {
  26. res, err := d.Infos(c, ipList)
  27. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  28. ctx.So(err, convey.ShouldBeNil)
  29. ctx.So(res, convey.ShouldNotBeNil)
  30. })
  31. })
  32. }
  33. func TestDaoCheckRealnameStatus(t *testing.T) {
  34. var (
  35. c = context.Background()
  36. mid int64 = 1
  37. )
  38. convey.Convey("CheckRealnameStatus", t, func(ctx convey.C) {
  39. res, err := d.CheckRealnameStatus(c, mid)
  40. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  41. ctx.So(err, convey.ShouldBeNil)
  42. ctx.So(res, convey.ShouldNotBeNil)
  43. })
  44. })
  45. }