dao_test.go 444 B

123456789101112131415161718192021222324252627282930
  1. package dao
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "go-common/app/admin/ep/melloi/conf"
  7. _ "github.com/go-sql-driver/mysql"
  8. "gopkg.in/h2non/gock.v1"
  9. )
  10. var (
  11. d *Dao
  12. c context.Context
  13. )
  14. func init() {
  15. dir, _ := filepath.Abs("../cmd/convey-test.toml")
  16. flag.Set("conf", dir)
  17. conf.Init()
  18. d = New(conf.Conf)
  19. d.httpClient.SetTransport(gock.DefaultTransport)
  20. c = ctx()
  21. }
  22. func ctx() context.Context {
  23. return context.Background()
  24. }