user_like_test.go 600 B

123456789101112131415161718192021222324252627282930313233
  1. package dao
  2. import (
  3. "context"
  4. "flag"
  5. "fmt"
  6. "go-common/app/interface/bbq/app-bbq/conf"
  7. "testing"
  8. )
  9. var (
  10. d *Dao
  11. )
  12. func init() {
  13. flag.Set("conf", "../cmd/")
  14. flag.Set("conf_name", "test.toml")
  15. flag.Set("app_setting_name", "app_setting.toml")
  16. flag.Set("deploy.env", "uat")
  17. flag.Parse()
  18. if err := conf.Init(); err != nil {
  19. panic(err)
  20. }
  21. d = New(conf.Conf)
  22. }
  23. func TestUserLike(t *testing.T) {
  24. res, err := d.CheckUserLike(context.Background(), 88895104, []int64{74850, 2222})
  25. fmt.Printf("res: %v", res)
  26. if err != nil && len(res) == 0 {
  27. t.Errorf("user like fail: err(%v)", err)
  28. }
  29. }