oper_test.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package archive
  2. import (
  3. "context"
  4. . "github.com/smartystreets/goconvey/convey"
  5. "testing"
  6. )
  7. func Test_videoOperAttrsCtimes(t *testing.T) {
  8. Convey("获取vid的审核属性记录,按照ctime排序", t, WithDao(func(d *Dao) {
  9. vid := int64(8943315)
  10. attrs, ctimes, err := d.VideoOperAttrsCtimes(context.TODO(), vid)
  11. So(err, ShouldBeNil)
  12. So(len(attrs), ShouldEqual, len(ctimes))
  13. }))
  14. }
  15. func Test_ArchiveOper(t *testing.T) {
  16. Convey("test archive", t, WithDao(func(d *Dao) {
  17. m, err := d.ArchiveOper(context.Background(), 10116994)
  18. So(err, ShouldBeNil)
  19. So(m, ShouldNotBeNil)
  20. }))
  21. }
  22. func Test_VideoOper(t *testing.T) {
  23. Convey("test archive", t, WithDao(func(d *Dao) {
  24. m, err := d.VideoOper(context.Background(), 10116994)
  25. So(err, ShouldBeNil)
  26. So(m, ShouldNotBeNil)
  27. }))
  28. }
  29. func Test_PassedOper(t *testing.T) {
  30. Convey("test archive", t, WithDao(func(d *Dao) {
  31. m, err := d.PassedOper(context.Background(), 10116994)
  32. So(err, ShouldBeNil)
  33. So(m, ShouldNotBeNil)
  34. }))
  35. }
  36. func Test_VideoOperAttrsCtimes(t *testing.T) {
  37. Convey("test archive", t, WithDao(func(d *Dao) {
  38. _, _, err := d.VideoOperAttrsCtimes(context.Background(), 10116994)
  39. So(err, ShouldBeNil)
  40. }))
  41. }
  42. func Test_UpVideoOper(t *testing.T) {
  43. var c = context.Background()
  44. Convey("UpVideoOper", t, WithDao(func(d *Dao) {
  45. _, err := d.UpVideoOper(c, 0, 0)
  46. So(err, ShouldBeNil)
  47. }))
  48. }