search_test.go 606 B

12345678910111213141516171819202122232425262728293031323334
  1. package search
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "time"
  8. "go-common/app/interface/main/app-feed/conf"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. var (
  12. d *Dao
  13. )
  14. func init() {
  15. dir, _ := filepath.Abs("../../cmd/app-feed-test.toml")
  16. flag.Set("conf", dir)
  17. conf.Init()
  18. d = New(conf.Conf)
  19. time.Sleep(time.Second)
  20. }
  21. func TestGetAudios(t *testing.T) {
  22. Convey("get GetAudios all", t, func() {
  23. res, trackID, err := d.Follow(context.Background(), "ios", "iphone", "phone", "xxx", 1, 1)
  24. So(res, ShouldNotBeEmpty)
  25. So(trackID, ShouldNotBeEmpty)
  26. So(err, ShouldBeNil)
  27. })
  28. }