Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package goblin
import (
"context"
"testing"
"go-common/library/database/sql"
"github.com/smartystreets/goconvey/convey"
)
func TestGoblinLabel(t *testing.T) {
var (
c = context.Background()
category = int(1)
catType = int(1)
)
convey.Convey("Label", t, func(ctx convey.C) {
ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
res, err := d.Label(c, category, catType)
ctx.So(err, convey.ShouldBeNil)
ctx.So(res, convey.ShouldNotBeNil)
})
ctx.Convey("db closed", func(ctx convey.C) {
d.db.Close()
_, err := d.Label(c, category, catType)
ctx.So(err, convey.ShouldNotBeNil)
d.db = sql.NewMySQL(d.conf.Mysql)
})
})
}