archive_test.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestService_Matsuri(t *testing.T) {
  9. Convey("matsuri", t, WithService(func(s *Service) {
  10. data := s.Matsuri(context.Background(), time.Now())
  11. So(data, ShouldNotBeNil)
  12. }))
  13. }
  14. func TestService_View(t *testing.T) {
  15. Convey("view", t, WithService(func(s *Service) {
  16. aid := int64(10097666)
  17. data, err := s.View(context.Background(), aid)
  18. So(err, ShouldBeNil)
  19. So(data, ShouldNotBeNil)
  20. }))
  21. }
  22. func TestService_PageList(t *testing.T) {
  23. Convey("pagelist", t, WithService(func(s *Service) {
  24. aid := int64(10097666)
  25. data, err := s.PageList(context.Background(), aid)
  26. So(err, ShouldBeNil)
  27. So(len(data), ShouldBeGreaterThan, 0)
  28. }))
  29. }
  30. func TestService_VideoShot(t *testing.T) {
  31. Convey("video shot", t, WithService(func(s *Service) {
  32. aid := int64(10097666)
  33. cid := int64(10108404)
  34. index := true
  35. data, err := s.VideoShot(context.Background(), aid, cid, index)
  36. So(err, ShouldBeNil)
  37. So(data, ShouldNotBeNil)
  38. }))
  39. }
  40. func TestService_PlayURLToken(t *testing.T) {
  41. Convey("playurl token", t, WithService(func(s *Service) {
  42. mid := int64(88895029)
  43. aid := int64(10097666)
  44. cid := int64(10108404)
  45. data, err := s.PlayURLToken(context.Background(), mid, aid, cid)
  46. So(err, ShouldBeNil)
  47. So(data, ShouldNotBeNil)
  48. }))
  49. }