dao_test.go 542 B

123456789101112131415161718192021222324252627282930313233343536
  1. package offer
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "time"
  8. . "github.com/smartystreets/goconvey/convey"
  9. "go-common/app/job/main/app-wall/conf"
  10. )
  11. var (
  12. d *Dao
  13. )
  14. func ctx() context.Context {
  15. return context.Background()
  16. }
  17. func init() {
  18. dir, _ := filepath.Abs("../../cmd/app-wall-job-test.toml")
  19. flag.Set("conf", dir)
  20. conf.Init()
  21. d = New(conf.Conf)
  22. time.Sleep(time.Second)
  23. }
  24. func TestActive(t *testing.T) {
  25. Convey("Active", t, func() {
  26. err := d.Active(ctx(), "", "", "", "", "")
  27. So(err, ShouldBeNil)
  28. })
  29. }