track_test.go 618 B

12345678910111213141516171819202122232425262728293031
  1. package track
  2. import (
  3. "context"
  4. . "github.com/smartystreets/goconvey/convey"
  5. "testing"
  6. )
  7. func WithDao(f func(d *Dao)) func() {
  8. return func() {
  9. Reset(func() {})
  10. f(d)
  11. }
  12. }
  13. func Test_trackvideo(t *testing.T) {
  14. Convey("根据filename + aid获取视频track信息", t, WithDao(func(d *Dao) {
  15. aid := int64(101010)
  16. filename := "i123123123123"
  17. _, err := d.VideoTrack(context.TODO(), filename, aid)
  18. So(err, ShouldBeNil)
  19. }))
  20. }
  21. func Test_ArchiveTrack(t *testing.T) {
  22. Convey("", t, WithDao(func(d *Dao) {
  23. aid := int64(101010)
  24. _, err := d.ArchiveTrack(context.TODO(), aid)
  25. So(err, ShouldBeNil)
  26. }))
  27. }