service_test.go 700 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package service
  2. import (
  3. "flag"
  4. "path/filepath"
  5. "testing"
  6. "go-common/app/job/main/archive-shjd/conf"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. var (
  10. s *Service
  11. )
  12. func init() {
  13. dir, _ := filepath.Abs("../cmd/archive-job-kisjd-test.toml")
  14. flag.Set("conf", dir)
  15. conf.Init()
  16. s = New(conf.Conf)
  17. }
  18. func Test_Ping(t *testing.T) {
  19. Convey("Ping", t, func() {
  20. s.Ping()
  21. })
  22. }
  23. func Test_DelteVideoCache(t *testing.T) {
  24. Convey("DelteVideoCache", t, func() {
  25. s.DelteVideoCache(1, 1)
  26. })
  27. }
  28. func Test_UpdateVideoCache(t *testing.T) {
  29. Convey("UpdateVideoCache", t, func() {
  30. s.UpdateVideoCache(1, 1)
  31. })
  32. }
  33. func Test_Close(t *testing.T) {
  34. Convey("Close", t, func() {
  35. s.Close()
  36. })
  37. }