dao_test.go 603 B

12345678910111213141516171819202122232425262728293031323334
  1. package dao
  2. import (
  3. "flag"
  4. "path/filepath"
  5. "testing"
  6. "go-common/app/interface/main/push/conf"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. var d *Dao
  10. func init() {
  11. dir, _ := filepath.Abs("../cmd/push-interface-test.toml")
  12. flag.Set("conf", dir)
  13. conf.Init()
  14. d = New(conf.Conf)
  15. }
  16. func WithDao(f func(d *Dao)) func() {
  17. return func() {
  18. f(d)
  19. }
  20. }
  21. func Test_MiInvalidTokens(t *testing.T) {
  22. Convey("fetch mi invalid tokens", t, WithDao(func(d *Dao) {
  23. // 用的时候打开,消息消费完了就没了
  24. // err := d.DelInvalidMiReports(context.TODO())
  25. // So(err, ShouldBeNil)
  26. }))
  27. }