log_test.go 728 B

123456789101112131415161718192021222324252627282930313233
  1. package http
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/aegis/model"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestHttpQueryLogSearch(t *testing.T) {
  9. convey.Convey("QueryLogSearch", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. args = &model.ParamsQueryLog{
  13. Business: 231,
  14. Int0From: "0",
  15. Int1: []int64{0, 1},
  16. Int2: []int64{0},
  17. Str0: []string{"0"},
  18. CtimeFrom: "2019-01-01 00:00:00",
  19. }
  20. escm = model.EsCommon{Ps: 10, Pn: 1, Order: "ctime", Sort: "desc"}
  21. )
  22. ctx.Convey("success", func(ctx convey.C) {
  23. res, err := d.QueryLogSearch(c, args, escm)
  24. ctx.So(err, convey.ShouldBeNil)
  25. ctx.So(res, convey.ShouldNotBeNil)
  26. })
  27. })
  28. }