room_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package v1
  2. import (
  3. "context"
  4. "flag"
  5. "fmt"
  6. "testing"
  7. "go-common/app/interface/live/app-ucenter/api/http/v1"
  8. "go-common/library/net/metadata"
  9. . "github.com/smartystreets/goconvey/convey"
  10. "go-common/app/interface/live/app-ucenter/conf"
  11. )
  12. var room *RoomService
  13. func init() {
  14. flag.Set("conf", "../../cmd/test.toml")
  15. if err := conf.Init(); err != nil {
  16. panic(err)
  17. }
  18. room = NewRoomService(conf.Conf)
  19. }
  20. // group=qa01 DEPLOY_ENV=uat go test -run TestGetRoomInfo
  21. func TestGetRoomInfo(t *testing.T) {
  22. Convey("TestNewRoomService", t, func() {
  23. ctx := metadata.NewContext(context.TODO(), metadata.MD{
  24. metadata.Mid: int64(16299525),
  25. })
  26. res, err := room.GetInfo(ctx, &v1.GetRoomInfoReq{
  27. Platform: "ios",
  28. })
  29. fmt.Println(1111, res, err, 22222)
  30. t.Logf("%v,%s", res, err)
  31. So(err, ShouldBeNil)
  32. })
  33. }
  34. func TestCreate(t *testing.T) {
  35. Convey("TestNewRoomService", t, func() {
  36. ctx := metadata.NewContext(context.TODO(), metadata.MD{
  37. metadata.Mid: int64(16299525),
  38. })
  39. res, err := room.Create(ctx, &v1.CreateReq{
  40. Platform: "ios",
  41. })
  42. fmt.Println(1111, res, err, 22222)
  43. t.Logf("%v,%s", res, err)
  44. So(err, ShouldBeNil)
  45. })
  46. }