protect_test.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestAddProtectApply(t *testing.T) {
  8. Convey("test add protect apply", t, func() {
  9. err := svr.AddProtectApply(context.TODO(), 27515256, 10108163, []int64{719925843, 719925844})
  10. So(err, ShouldBeNil)
  11. })
  12. }
  13. func TestUptPaSwitch(t *testing.T) {
  14. Convey("test upt pa switch", t, func() {
  15. err := svr.UptPaSwitch(context.TODO(), 27515256, 1)
  16. So(err, ShouldBeNil)
  17. err = svr.UptPaSwitch(context.TODO(), 27515256, 0)
  18. So(err, ShouldBeNil)
  19. })
  20. }
  21. func TestUptPaStatus(t *testing.T) {
  22. Convey("test upt pa status", t, func() {
  23. err := svr.UptPaStatus(context.TODO(), 27515256, []int64{541, 542}, 1)
  24. So(err, ShouldBeNil)
  25. err = svr.UptPaStatus(context.TODO(), 27515256, []int64{541, 542}, -1)
  26. So(err, ShouldBeNil)
  27. })
  28. }
  29. func TestProtectApplies(t *testing.T) {
  30. Convey("test protect applies", t, func() {
  31. res, err := svr.ProtectApplies(context.TODO(), 27515256, 10097377, 1, "playtime")
  32. So(err, ShouldBeNil)
  33. So(res, ShouldNotBeNil)
  34. })
  35. }
  36. func TestPaVideoLs(t *testing.T) {
  37. Convey("test pa video ls", t, func() {
  38. _, err := svr.PaVideoLs(context.TODO(), 27515256)
  39. So(err, ShouldBeNil)
  40. })
  41. }