extra_func_test.go 786 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package service
  2. import (
  3. "context"
  4. "flag"
  5. "testing"
  6. "go-common/app/job/main/videoup/conf"
  7. . "github.com/smartystreets/goconvey/convey"
  8. "path/filepath"
  9. )
  10. var (
  11. s *Service
  12. )
  13. func init() {
  14. dir, _ := filepath.Abs("../cmd/videoup-job-test.toml")
  15. flag.Set("conf", dir)
  16. conf.Init()
  17. s = New(conf.Conf)
  18. }
  19. func TestArchiveVideo(t *testing.T) {
  20. Convey("test archive video", t, func() {
  21. v, a, err := s.archiveVideo(context.Background(), "j171212at3l9zsodcv33n5b7y2ihz0m0")
  22. So(err, ShouldBeNil)
  23. So(a, ShouldNotBeNil)
  24. So(v, ShouldNotBeNil)
  25. t.Logf("resp: %v", a)
  26. })
  27. }
  28. func TestService_IsUpperFirstPass(t *testing.T) {
  29. Convey("", t, func() {
  30. is, err := s.IsUpperFirstPass(context.Background(), 17515232, 10101454)
  31. So(err, ShouldBeNil)
  32. So(is, ShouldNotBeNil)
  33. })
  34. }