service_test.go 604 B

123456789101112131415161718192021222324252627282930313233343536
  1. package service
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "go-common/app/interface/main/app-player/conf"
  8. "go-common/app/interface/main/app-player/model"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. var (
  12. s *Service
  13. )
  14. func init() {
  15. dir, _ := filepath.Abs("../cmd/app-player-test.toml")
  16. flag.Set("conf", dir)
  17. conf.Init()
  18. s = New(conf.Conf)
  19. }
  20. func Test_Playurl(t *testing.T) {
  21. var params = &model.Param{
  22. AID: 1,
  23. MobiApp: "android",
  24. CID: 1,
  25. Qn: 32,
  26. }
  27. Convey("Test_Playurl", t, func() {
  28. s.Playurl(context.TODO(), 1, params, 1, "dajskldasjkl", "")
  29. })
  30. }