video_test.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/videoup/model/archive"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestService_VideoAudit(t *testing.T) {
  9. var (
  10. c = context.TODO()
  11. vp = &archive.VideoParam{}
  12. )
  13. attrs := make(map[uint]int32, 5)
  14. attrs[archive.AttrBitNoRank] = 1
  15. attrs[archive.AttrBitNoDynamic] = 1
  16. attrs[archive.AttrBitNoSearch] = 1
  17. attrs[archive.AttrBitNoRecommend] = 1
  18. attrs[archive.AttrBitOverseaLock] = 1
  19. Convey("VideoAudit", t, WithService(func(s *Service) {
  20. err := svr.VideoAudit(c, vp, attrs)
  21. So(err, ShouldBeNil)
  22. }))
  23. }
  24. func TestService_UpVideo(t *testing.T) {
  25. var (
  26. c = context.TODO()
  27. vp = &archive.VideoParam{}
  28. )
  29. Convey("UpVideo", t, WithService(func(s *Service) {
  30. err := svr.UpVideo(c, vp)
  31. So(err, ShouldNotBeNil)
  32. }))
  33. }
  34. func TestService_UpWebLink(t *testing.T) {
  35. var (
  36. c = context.TODO()
  37. vp = &archive.VideoParam{}
  38. )
  39. Convey("UpWebLink", t, WithService(func(s *Service) {
  40. err := svr.UpWebLink(c, vp)
  41. So(err, ShouldBeNil)
  42. }))
  43. }
  44. func TestService_DelVideo(t *testing.T) {
  45. var (
  46. c = context.TODO()
  47. vp = &archive.VideoParam{}
  48. )
  49. Convey("DelVideo", t, WithService(func(s *Service) {
  50. err := svr.DelVideo(c, vp)
  51. So(err, ShouldNotBeNil)
  52. }))
  53. }
  54. func TestService_ChangeIndex(t *testing.T) {
  55. var (
  56. c = context.TODO()
  57. vp = &archive.IndexParam{}
  58. )
  59. Convey("ChangeIndex", t, WithService(func(s *Service) {
  60. err := svr.ChangeIndex(c, vp)
  61. So(err, ShouldNotBeNil)
  62. }))
  63. }