go-common/app/interface/live/app-interface/service/v1/index_test.go

44 lines
876 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package v1
import (
"context"
"flag"
"testing"
. "github.com/smartystreets/goconvey/convey"
api "go-common/app/interface/live/app-interface/api/http/v1"
"go-common/app/interface/live/app-interface/conf"
bm "go-common/library/net/http/blademaster"
)
var (
s *Service
)
func init() {
flag.Set("conf", "../../cmd/test.toml")
var err error
if err = conf.Init(); err != nil {
panic(err)
}
s = New(conf.Conf)
}
// go test -test.v -test.run TestGetAllList
func TestGetAllList(t *testing.T) {
Convey("TestGetAllList", t, func() {
res, err := s.GetAllList(&bm.Context{Context: context.TODO()}, &api.GetAllListReq{})
t.Logf("%v", res)
So(err, ShouldBeNil)
})
}
func TestChange(t *testing.T) {
Convey("TestChange", t, func() {
res, err := s.Change(&bm.Context{Context: context.TODO()}, &api.ChangeReq{})
t.Logf("%v", res)
So(err, ShouldBeNil)
})
}