splash_test.go 613 B

1234567891011121314151617181920212223242526272829
  1. package goblin
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/library/database/sql"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestGoblinChlInfo(t *testing.T) {
  9. var (
  10. ctx = context.Background()
  11. )
  12. convey.Convey("ChlInfo", t, func(c convey.C) {
  13. c.Convey("Then err should be nil.chls should not be nil.", func(c convey.C) {
  14. chls, err := d.ChlInfo(ctx)
  15. c.So(err, convey.ShouldBeNil)
  16. c.So(chls, convey.ShouldNotBeNil)
  17. })
  18. c.Convey("db closed", func(c convey.C) {
  19. d.db.Close()
  20. _, err := d.ChlInfo(ctx)
  21. c.So(err, convey.ShouldNotBeNil)
  22. d.db = sql.NewMySQL(d.conf.Mysql)
  23. })
  24. })
  25. }