archive_stat_test.go 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/admin/main/laser/model"
  5. "testing"
  6. "time"
  7. "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestServiceArchiveRecheck(t *testing.T) {
  10. convey.Convey("ArchiveRecheck", t, func(convCtx convey.C) {
  11. var (
  12. c = context.Background()
  13. typeIDS = []int64{}
  14. unames = ""
  15. startDate = int64(0)
  16. endDate = int64(0)
  17. )
  18. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  19. s.ArchiveRecheck(c, typeIDS, unames, startDate, endDate)
  20. convCtx.Convey("Then err should be nil.recheckViews should not be nil.", func(convCtx convey.C) {
  21. })
  22. })
  23. })
  24. }
  25. func TestServiceUserRecheck(t *testing.T) {
  26. convey.Convey("UserRecheck", t, func(convCtx convey.C) {
  27. var (
  28. c = context.Background()
  29. typeIDS = []int64{}
  30. unames = ""
  31. startDate = int64(0)
  32. endDate = int64(0)
  33. )
  34. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  35. s.UserRecheck(c, typeIDS, unames, startDate, endDate)
  36. convCtx.Convey("Then err should be nil.recheckViews should not be nil.", func(convCtx convey.C) {
  37. })
  38. })
  39. })
  40. }
  41. func TestServiceDailyStatArchiveRecheck(t *testing.T) {
  42. convey.Convey("dailyStatArchiveRecheck", t, func(convCtx convey.C) {
  43. var (
  44. c = context.Background()
  45. business = int(0)
  46. typeIDS = []int64{}
  47. statTypes = []int64{}
  48. uids = []int64{}
  49. statDate = time.Now()
  50. )
  51. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  52. s.dailyStatArchiveRecheck(c, business, typeIDS, statTypes, uids, statDate)
  53. convCtx.Convey("Then err should be nil.statViews should not be nil.", func(convCtx convey.C) {
  54. })
  55. })
  56. })
  57. }
  58. func TestServicemakeUpArchiveRecheck(t *testing.T) {
  59. convey.Convey("makeUpArchiveRecheck", t, func(convCtx convey.C) {
  60. var (
  61. mediateView map[int64]map[int]int64
  62. )
  63. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  64. makeUpArchiveRecheck(mediateView)
  65. convCtx.Convey("Then statViews should not be nil.", func(convCtx convey.C) {
  66. })
  67. })
  68. })
  69. }
  70. func TestServiceDailyStatArchiveStat(t *testing.T) {
  71. convey.Convey("dailyArchiveStat", t, func(convCtx convey.C) {
  72. var (
  73. c = context.Background()
  74. business = int(0)
  75. typeIDS = []int64{}
  76. statTypes = []int64{}
  77. uids = []int64{}
  78. statDate = time.Now()
  79. )
  80. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  81. s.dailyArchiveStat(c, business, typeIDS, statTypes, uids, statDate)
  82. convCtx.Convey("Then err should be nil.mediateView should not be nil.", func(convCtx convey.C) {
  83. })
  84. })
  85. })
  86. }
  87. func TestServiceTagRecheck(t *testing.T) {
  88. convey.Convey("TagRecheck", t, func(convCtx convey.C) {
  89. var (
  90. c = context.Background()
  91. startDate = int64(0)
  92. endDate = int64(0)
  93. unames = ""
  94. )
  95. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  96. s.TagRecheck(c, startDate, endDate, unames)
  97. convCtx.Convey("Then err should be nil.tagViews should not be nil.", func(convCtx convey.C) {
  98. })
  99. })
  100. })
  101. }
  102. func TestServiceDailyStatTagRecheck(t *testing.T) {
  103. convey.Convey("dailyStatTagRecheck", t, func(convCtx convey.C) {
  104. var (
  105. c = context.Background()
  106. business = int(0)
  107. statTypes = []int64{}
  108. uids = []int64{}
  109. statDate = time.Now()
  110. )
  111. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  112. s.dailyStatTagRecheck(c, business, statTypes, uids, statDate)
  113. convCtx.Convey("Then err should be nil.statViews should not be nil.", func(convCtx convey.C) {
  114. })
  115. })
  116. })
  117. }
  118. func TestServicemakeUpTagRecheck(t *testing.T) {
  119. convey.Convey("makeUpTagRecheck", t, func(convCtx convey.C) {
  120. var (
  121. mediateView map[int64]map[int]int64
  122. )
  123. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  124. makeUpTagRecheck(mediateView)
  125. convCtx.Convey("Then statViews should not be nil.", func(convCtx convey.C) {
  126. })
  127. })
  128. })
  129. }
  130. func TestServiceRecheck123(t *testing.T) {
  131. convey.Convey("Recheck123", t, func(convCtx convey.C) {
  132. var (
  133. c = context.Background()
  134. startDate = int64(0)
  135. endDate = int64(0)
  136. typeIDS = []int64{}
  137. )
  138. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  139. s.Recheck123(c, startDate, endDate, typeIDS)
  140. convCtx.Convey("Then err should be nil.recheckView should not be nil.", func(convCtx convey.C) {
  141. })
  142. })
  143. })
  144. }
  145. func TestServiceDailyStatArchiveStreamStat(t *testing.T) {
  146. convey.Convey("dailyStatArchiveStreamStat", t, func(convCtx convey.C) {
  147. var (
  148. c = context.Background()
  149. business = int(0)
  150. typeIDS = []int64{}
  151. uids = []int64{}
  152. statTypes = []int64{}
  153. statDate = time.Now()
  154. )
  155. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  156. s.dailyStatArchiveStreamStat(c, business, typeIDS, uids, statTypes, statDate)
  157. convCtx.Convey("Then err should be nil.statViews should not be nil.", func(convCtx convey.C) {
  158. })
  159. })
  160. })
  161. }
  162. func TestServicewrap(t *testing.T) {
  163. convey.Convey("wrap", t, func(convCtx convey.C) {
  164. var (
  165. cargoMap map[int64]*model.CargoItem
  166. )
  167. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  168. wrap(cargoMap)
  169. convCtx.Convey("Then views should not be nil.", func(convCtx convey.C) {
  170. })
  171. })
  172. })
  173. }
  174. func TestServiceCsvAuditCargo(t *testing.T) {
  175. convey.Convey("CsvAuditCargo", t, func(convCtx convey.C) {
  176. var (
  177. c = context.Background()
  178. startDate = int64(0)
  179. endDate = int64(0)
  180. unames = ""
  181. )
  182. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  183. s.CsvAuditCargo(c, startDate, endDate, unames)
  184. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  185. })
  186. })
  187. })
  188. }
  189. func TestServiceAuditorCargoList(t *testing.T) {
  190. convey.Convey("AuditorCargoList", t, func(convCtx convey.C) {
  191. var (
  192. c = context.Background()
  193. startDate = int64(0)
  194. endDate = int64(0)
  195. unames = ""
  196. )
  197. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  198. s.AuditorCargoList(c, startDate, endDate, unames)
  199. convCtx.Convey("Then err should be nil.wrappers,lineWidth should not be nil.", func(convCtx convey.C) {
  200. })
  201. })
  202. })
  203. }
  204. func TestServiceCsvRandomVideoAudit(t *testing.T) {
  205. convey.Convey("CsvRandomVideoAudit", t, func(convCtx convey.C) {
  206. var (
  207. c = context.Background()
  208. startDate = int64(0)
  209. endDate = int64(0)
  210. unames = ""
  211. typeIDS = []int64{}
  212. )
  213. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  214. s.CsvRandomVideoAudit(c, startDate, endDate, unames, typeIDS)
  215. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  216. })
  217. })
  218. })
  219. }
  220. func TestServiceCsvFixedVideoAudit(t *testing.T) {
  221. convey.Convey("CsvFixedVideoAudit", t, func(convCtx convey.C) {
  222. var (
  223. c = context.Background()
  224. startDate = int64(0)
  225. endDate = int64(0)
  226. unames = ""
  227. typeIDS = []int64{}
  228. )
  229. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  230. s.CsvFixedVideoAudit(c, startDate, endDate, unames, typeIDS)
  231. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  232. })
  233. })
  234. })
  235. }
  236. func TestServiceRandomVideo(t *testing.T) {
  237. convey.Convey("RandomVideo", t, func(convCtx convey.C) {
  238. var (
  239. c = context.Background()
  240. startDate = int64(0)
  241. endDate = int64(0)
  242. typeIDS = []int64{}
  243. uname = ""
  244. )
  245. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  246. s.RandomVideo(c, startDate, endDate, typeIDS, uname)
  247. convCtx.Convey("Then err should be nil.statViewExts,lineWidth should not be nil.", func(convCtx convey.C) {
  248. })
  249. })
  250. })
  251. }
  252. func TestServiceFixedVideo(t *testing.T) {
  253. convey.Convey("FixedVideo", t, func(convCtx convey.C) {
  254. var (
  255. c = context.Background()
  256. startDate = int64(0)
  257. endDate = int64(0)
  258. typeIDS = []int64{}
  259. uname = ""
  260. )
  261. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  262. s.FixedVideo(c, startDate, endDate, typeIDS, uname)
  263. convCtx.Convey("Then err should be nil.statViewExts,lineWidth should not be nil.", func(convCtx convey.C) {
  264. })
  265. })
  266. })
  267. }
  268. func TestServiceVideoAudit(t *testing.T) {
  269. convey.Convey("videoAudit", t, func(convCtx convey.C) {
  270. var (
  271. c = context.Background()
  272. business = int(0)
  273. statDate = time.Now()
  274. typeIDS = []int64{}
  275. unames = ""
  276. )
  277. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  278. s.videoAudit(c, business, statDate, typeIDS, unames)
  279. convCtx.Convey("Then err should be nil.viewExts,lineWidth should not be nil.", func(convCtx convey.C) {
  280. })
  281. })
  282. })
  283. }
  284. func TestServicestatNode2ViewExt(t *testing.T) {
  285. convey.Convey("statNode2ViewExt", t, func(convCtx convey.C) {
  286. var (
  287. c = context.Background()
  288. statNodes = []*model.StatNode{}
  289. needALL = false
  290. )
  291. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  292. s.statNode2ViewExt(c, statNodes, needALL)
  293. convCtx.Convey("Then err should be nil.statViewsExts,lineWidth should not be nil.", func(convCtx convey.C) {
  294. })
  295. })
  296. })
  297. }