dao_test.go 466 B

123456789101112131415161718192021222324252627282930313233
  1. package dao
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "go-common/app/admin/main/sms/conf"
  8. . "github.com/smartystreets/goconvey/convey"
  9. )
  10. var d *Dao
  11. func init() {
  12. dir, _ := filepath.Abs("../cmd/sms-admin-test.toml")
  13. flag.Set("conf", dir)
  14. conf.Init()
  15. d = New(conf.Conf)
  16. }
  17. func Test_Ping(t *testing.T) {
  18. Convey("Ping", t, func() {
  19. d.Ping(context.TODO())
  20. })
  21. }
  22. func Test_Close(t *testing.T) {
  23. Convey("close", t, func() {
  24. d.Close()
  25. })
  26. }