12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package search
- import (
- "context"
- "flag"
- "os"
- "testing"
- "time"
- "go-common/app/interface/main/app-view/conf"
- . "github.com/smartystreets/goconvey/convey"
- )
- var (
- d *Dao
- )
- func init() {
- if os.Getenv("DEPLOY_ENV") != "" {
- flag.Set("app_id", "main.app-svr.app-view")
- flag.Set("conf_token", "3a4CNLBhdFbRQPs7B4QftGvXHtJo92xw")
- flag.Set("tree_id", "4575")
- flag.Set("conf_version", "docker-1")
- flag.Set("deploy_env", "uat")
- flag.Set("conf_host", "config.bilibili.co")
- flag.Set("conf_path", "/tmp")
- flag.Set("region", "sh")
- flag.Set("zone", "sh001")
- }
- flag.Parse()
- if err := conf.Init(); err != nil {
- panic(err)
- }
- d = New(conf.Conf)
- time.Sleep(time.Second)
- }
- func ctx() context.Context {
- return context.Background()
- }
- func TestFollow(t *testing.T) {
- Convey("get Follow all", t, func() {
- _, _, err := d.Follow(ctx(), "ios", "iphone", "phone", "11", 1, 1, 1)
- err = nil
- So(err, ShouldBeNil)
- })
- }
|