You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
706 B
36 lines
706 B
package v2 |
|
|
|
import ( |
|
"context" |
|
"flag" |
|
"testing" |
|
|
|
foo "go-common/app/interface/live/live-demo/api/http/v2" |
|
"go-common/app/interface/live/live-demo/conf" |
|
"go-common/app/interface/live/live-demo/dao" |
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
var ( |
|
s *FooService |
|
) |
|
|
|
func init() { |
|
flag.Set("conf", "../../cmd/test.toml") |
|
var err error |
|
if err = conf.Init(); err != nil { |
|
panic(err) |
|
} |
|
s = NewFooService(conf.Conf) |
|
dao.InitAPI() |
|
} |
|
|
|
// go test -test.v -test.run TestService_GetInfo |
|
func TestService_GetInfo(t *testing.T) { |
|
Convey("TestService_GetInfo", t, func() { |
|
res, err := s.GetInfo(context.TODO(), &foo.GetInfoReq{RoomId: 10002}) |
|
t.Logf("%v msg", res) |
|
So(err, ShouldBeNil) |
|
}) |
|
}
|
|
|