query_extra_test.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/admin/main/search/model"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoArchiveVideoScore(t *testing.T) {
  9. convey.Convey("ArchiveVideoScore", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. sp = &model.QueryParams{
  13. QueryBody: &model.QueryBody{},
  14. AppIDConf: &model.QueryConfDetail{
  15. ESCluster: "",
  16. },
  17. }
  18. )
  19. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  20. _, debug, err := d.ArchiveVideoScore(c, sp)
  21. ctx.Convey("Then err should be nil.res,debug should not be nil.", func(ctx convey.C) {
  22. ctx.So(err, convey.ShouldBeNil)
  23. ctx.So(debug, convey.ShouldNotBeNil)
  24. //ctx.So(res, convey.ShouldNotBeNil)
  25. })
  26. })
  27. })
  28. }
  29. func TestDaoArchiveScore(t *testing.T) {
  30. convey.Convey("ArchiveScore", t, func(ctx convey.C) {
  31. var (
  32. c = context.Background()
  33. sp = &model.QueryParams{
  34. QueryBody: &model.QueryBody{},
  35. AppIDConf: &model.QueryConfDetail{
  36. ESCluster: "",
  37. },
  38. }
  39. )
  40. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  41. _, debug, err := d.ArchiveScore(c, sp)
  42. ctx.Convey("Then err should be nil.res,debug should not be nil.", func(ctx convey.C) {
  43. ctx.So(err, convey.ShouldBeNil)
  44. ctx.So(debug, convey.ShouldNotBeNil)
  45. //ctx.So(res, convey.ShouldNotBeNil)
  46. })
  47. })
  48. })
  49. }
  50. func TestDaoTaskQaRandom(t *testing.T) {
  51. convey.Convey("TaskQaRandom", t, func(ctx convey.C) {
  52. var (
  53. c = context.Background()
  54. sp = &model.QueryParams{
  55. QueryBody: &model.QueryBody{},
  56. AppIDConf: &model.QueryConfDetail{
  57. ESCluster: "",
  58. },
  59. }
  60. )
  61. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  62. _, debug, err := d.TaskQaRandom(c, sp)
  63. ctx.Convey("Then err should be nil.res,debug should not be nil.", func(ctx convey.C) {
  64. ctx.So(err, convey.ShouldBeNil)
  65. ctx.So(debug, convey.ShouldNotBeNil)
  66. //ctx.So(res, convey.ShouldNotBeNil)
  67. })
  68. })
  69. })
  70. }
  71. func TestDaoEsportsContestsDate(t *testing.T) {
  72. convey.Convey("EsportsContestsDate", t, func(ctx convey.C) {
  73. var (
  74. c = context.Background()
  75. sp = &model.QueryParams{
  76. QueryBody: &model.QueryBody{},
  77. AppIDConf: &model.QueryConfDetail{
  78. ESCluster: "pcie_pub_out01",
  79. },
  80. }
  81. )
  82. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  83. //res, debug, err :=
  84. d.EsportsContestsDate(c, sp)
  85. ctx.Convey("Then err should be nil.res,debug should not be nil.", func(ctx convey.C) {
  86. //ctx.So(err, convey.ShouldBeNil)
  87. //ctx.So(debug, convey.ShouldNotBeNil)
  88. //ctx.So(res, convey.ShouldNotBeNil)
  89. })
  90. })
  91. })
  92. }
  93. func TestDaoCreativeArchiveSearch(t *testing.T) {
  94. convey.Convey("CreativeArchiveSearch", t, func(ctx convey.C) {
  95. var (
  96. c = context.Background()
  97. sp = &model.QueryParams{
  98. QueryBody: &model.QueryBody{
  99. Where: &model.QueryBodyWhere{
  100. EQ: map[string]interface{}{"mid": 1},
  101. },
  102. },
  103. AppIDConf: &model.QueryConfDetail{
  104. ESCluster: "ssd_pub_in01",
  105. },
  106. }
  107. )
  108. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  109. //res, debug, err :=
  110. d.CreativeArchiveSearch(c, sp)
  111. ctx.Convey("Then err should be nil.res,debug should not be nil.", func(ctx convey.C) {
  112. //ctx.So(err, convey.ShouldBeNil)
  113. //ctx.So(debug, convey.ShouldNotBeNil)
  114. //ctx.So(res, convey.ShouldNotBeNil)
  115. })
  116. })
  117. })
  118. }
  119. func TestDaoCreativeArchiveStaff(t *testing.T) {
  120. convey.Convey("CreativeArchiveStaff", t, func(ctx convey.C) {
  121. var (
  122. c = context.Background()
  123. sp = &model.QueryParams{
  124. QueryBody: &model.QueryBody{
  125. Where: &model.QueryBodyWhere{
  126. Combo: []model.QueryBodyWhereCombo{
  127. {
  128. EQ: []map[string]interface{}{{"mid": 1}},
  129. },
  130. },
  131. Like: []model.QueryBodyWhereLike{{
  132. KWFields: []string{"title"},
  133. KW: []string{"title"},
  134. }},
  135. },
  136. },
  137. AppIDConf: &model.QueryConfDetail{
  138. ESCluster: "ssd_pub_in02",
  139. },
  140. }
  141. )
  142. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  143. //res, debug, err :=
  144. d.CreativeArchiveStaff(c, sp)
  145. ctx.Convey("Then err should be nil.res,debug should not be nil.", func(ctx convey.C) {
  146. //ctx.So(err, convey.ShouldBeNil)
  147. //ctx.So(debug, convey.ShouldNotBeNil)
  148. //ctx.So(res, convey.ShouldNotBeNil)
  149. })
  150. })
  151. })
  152. }
  153. func TestDaoCreativeArchiveApply(t *testing.T) {
  154. convey.Convey("CreativeArchiveApply", t, func(ctx convey.C) {
  155. var (
  156. c = context.Background()
  157. sp = &model.QueryParams{
  158. QueryBody: &model.QueryBody{
  159. Where: &model.QueryBodyWhere{
  160. EQ: map[string]interface{}{"apply_staff.apply_staff_mid": "1"},
  161. Like: []model.QueryBodyWhereLike{{
  162. KWFields: []string{"title"},
  163. KW: []string{"title"},
  164. }},
  165. },
  166. },
  167. AppIDConf: &model.QueryConfDetail{
  168. ESCluster: "ssd_pub_in02",
  169. },
  170. }
  171. )
  172. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  173. //res, debug, err :=
  174. d.CreativeArchiveApply(c, sp)
  175. ctx.Convey("Then err should be nil.res,debug should not be nil.", func(ctx convey.C) {
  176. //ctx.So(err, convey.ShouldBeNil)
  177. //ctx.So(debug, convey.ShouldNotBeNil)
  178. //ctx.So(res, convey.ShouldNotBeNil)
  179. })
  180. })
  181. })
  182. }